title | description | titleSuffix | ms.date | ms.subservice | ms.service | ms.topic | ms.assetid | author | ms.author | manager | ms.localizationpriority | ms.collection | ms.reviewer |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Synchronize with the Software Update Point |
You synchronize the software update point, in Configuration Manager SP1, by calling the SyncNow method. |
Configuration Manager |
09/20/2016 |
sdk |
configuration-manager |
how-to |
bbc5fb02-8502-4003-8f4d-d69508674ce0 |
Banreet |
banreetkaur |
apoorvseth |
low |
tier3 |
mstewart,aaroncz |
You synchronize the software update point, in Configuration Manager SP1, by calling the SyncNow
method.
-
Set up a connection to the SMS Provider.
-
Create an instance of the SMS_SoftwareUpdate Server WMI Class class.
-
Create and populate the method parameter value
fullSync
. -
Call the SyncNow Method in Class SMS_SoftwareUpdate method, passing in the method parameter value.
The following example method shows how to synchronize the software update point by calling the SyncNow Method in Class SMS_SoftwareUpdate method.
For information about calling the sample code, see Calling Configuration Manager Code Snippets.
public void SynchronizeSoftwareUpdatePoint(WqlConnectionManager connection)
{
try
{
// Create the new SMS_SoftwareUpdate object.
IResultObject newSoftwareUpdate = connection.CreateInstance("SMS_SoftwareUpdate");
// Create dictionary object to pass parameters to the SyncNow method.
Dictionary<string, object> inParams = new Dictionary<string, object>();
inParams["fullSync"] = true;
// Initialize the outParams object.
IResultObject outParams = null;
// Call SyncNow method to initiate synchronization.
outParams = connection.ExecuteMethod("SMS_SoftwareUpdate", "SyncNow", inParams);
}
catch (SmsException ex)
{
Console.WriteLine("Failed. Error: " + ex.InnerException.Message);
}
}
The example method has the following parameters:
Parameter | Type | Description |
---|---|---|
connection |
- Managed: WqlConnectionManager |
A valid connection to the SMS Provider. |
The C# example has the following compilation requirements:
System
System.Collections.Generic
System.Text
Microsoft.ConfigurationManagement.ManagementProvider
Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine
adminui.wqlqueryengine
microsoft.configurationmanagement.managementprovider
For more information about error handling, see About Configuration Manager Errors.
For more information about securing Configuration Manager applications, see Configuration Manager role-based administration.
About software update deployments
SMS_SoftwareUpdate Server WMI Class
SyncNow Method in Class SMS_SoftwareUpdate