Synchronize WSUS Replica (slave) Server from the Command Line

Scripting guru Torgeir Bakken’s response;

Torgeir Bakken (MVP):

It is easy to create this command line utility yourself. WSUS expose .NET API’s that can be called from VB.NET, C#.NET, or other .NET languages.

The easiest way to develop .NET programs is to use Visual Studio, but VS is not required. The .NET Framework ships with all the basic tools necessary for building .NET programs.

To get a tool that starts a WSUS synchronization, do the following on the WSUS server:

1) Copy the code below and save it to a text file named

2) Open a command prompt, and navigate to the directory containing

3) Run the following command line (all one one line, you will need to
unwrap the line before running it!):

  StartSynchronization.vb /r:”%PROGRAMFILES%\Update Services\

This will create a tool called StartSynchronization.exe that when run
will start a WSUS synchronization.

Content of StartSynchronization.vb:

Imports Microsoft.UpdateServices.Administration

Module StartSynchronization

     Sub Main()
         Dim server As IUpdateServer
         Dim subscription As ISubscription

         ‘connect to the local server
         server = AdminProxy.GetUpdateServer

         subscription = server.GetSubscription()

     End Sub

End Module


More WSUS API information/examples:

“Windows Server Update Services API Samples and Tools” is available for
download here:…


Platform SDK: Windows Server Update Services

Leave a Reply

Your email address will not be published. Required fields are marked *