Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > PowerShell WSUS v3 Start Sync script

Reply
Thread Tools Display Modes

PowerShell WSUS v3 Start Sync script

 
 
Drewbles
Guest
Posts: n/a

 
      11-28-2007
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.Ad ministration") | 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:1 1 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:1 2 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.


 
Reply With Quote
 
 
 
 
Vernon Wells
Guest
Posts: n/a

 
      11-28-2011
for a wsus server using port 8530

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

You were really close.

> On Tuesday, November 27, 2007 9:48 PM Drewble wrote:


> 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.Ad ministration") | 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:1 1 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:1 2 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.




 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Learning Vb script or Powershell Allwyn Scripting 0 09-27-2007 12:14 PM
start powershell question ScottW Scripting 3 06-25-2007 04:30 PM
Old Monad script does not work when used with powershell Moonrox Scripting 3 11-05-2006 11:28 AM
Email from Powershell script HectorITNT Scripting 1 09-21-2006 12:15 PM
[PowerShell[ How do I log an event in a script? David Moisan Scripting 3 05-02-2006 06:15 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59