PowerShell WSUS v3 Start Sync script

Discussion in 'Scripting' started by Drewbles, Nov 28, 2007.

  1. Drewbles

    Drewbles Guest

    OK so I got the srcipt for Powershell that starts a Synchronization. Work
    fine if you run it from a WSUS (v3.0) server however if you try and change
    the 'GetUpdateServer()' value to look at a downstream server all I get is
    'Unable to connect to the remote server'. For the life of me I can't figure
    out why.

    Heres the script
    [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | Out-Null
    $wsus =
    [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer("ServerName","false");
    $wsus.GetSubscription().StartSynchronization();

    Heres the output:
    Exception calling "GetUpdateServer" with "2" argument(s): "Unable to connect
    to the remote server"
    At g:\Source\Scripts\Development\WSUS\StartSync.ps1:11 char:78
    + $wsus =
    [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer( <<<<
    "scocdc01p","false");
    You cannot call a method on a null-valued expression.
    At g:\Source\Scripts\Development\WSUS\StartSync.ps1:12 char:22
    + $wsus.GetSubscription( <<<< ).StartSynchronization();

    Just to confuse things more we are using the alternate port (8530) because
    the default port is already in use.

    Any help would be great.
     
    Drewbles, Nov 28, 2007
    #1
    1. Advertisements

  2. Drewbles

    Vernon Wells Guest

    for a wsus server using port 8530

    Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer("ServerName","false",8530);

    You were really close.
     
    Vernon Wells, Nov 28, 2011
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.