guidance on how to remotely run powershell function, please

This topic contains 2 replies, has 2 voices, and was last updated by  tommls 3 years, 4 months ago.

  • Author
  • #22749


    I am working on automating WSUS updates.

    I have a simple, basic script here that I can use:

    It's also a function, which is good 🙂

    My desire is to run the function remotely upon an array of servers, like so:

    foreach in $servers array, e.g. foreach ($server in $servers) {

    ** properly connect to server

    run the wsus update function

    sleep/wait a few minutes

    next server

    Is this a good way to do this and what code do I need to ** properly connect to the server??

    What is the proper code for server connection such that I can use $server and not the actual server name??

    Thank you, Tom

  • #22765

    Tim Pringle

    Hi Tom,

    Best thing i can recommend is to take a look at the free ebook [b]Secrets of PowerShell remoting[/b].

    You can find it via Resources / Free E-Books on this site or directly via :


  • #22767


    OIC — found and downloaded.

    Seems what I must do now is write a test script and practice having it run remotely on the servers, then work on the WSUS stuff.

    Thank you, Tom

You must be logged in to reply to this topic.