In Microsoft System Center Configuration Manager 2007, you configure software updates deployment properties that are required for interoperability with SMS 2003 by modifying the properties of an instance of the SMS_UpdatesAssignment Server WMI Class.

To configure software updates deployment properties required for SMS 2003 interoperability

  1. Set up a connection to the SMS Provider.

  2. Open a specific deployment (assignment) to change by using the assignment ID.

  3. Populate the interoperability properties.

  4. Save the deployment (assignment) and properties.

Example

The following example method shows how to configure the Software Updates Deployment properties that are required for interoperability with SMS 2003 clients by using the SMS_UpdatesAssignment class and class properties. Note that the parameters of the example method reflect certain properties of SMS_UpdatesAssignment.

For information about calling the sample code, see Calling Configuration Manager Code Snippets.

Visual Basic Script  Copy Code
Sub ConfigureSUMDeploymentPropertiesRequiredforInteroperability (connection, 				_
													existingAssignmentID, 	 _
													newLegacyAdvertFlags, 	 _
													newLegacyCollectInventory, _
													newLegacyDependentProgram, _
													newLegacyDeploymentEnabled,  _
													newLegacyDeploymentSchedule, _
													newLegacyDPLocality, 		_
													newLegacyForceReboot, 	 _
													newLegacyInstallAllOnDeadline,  _
													newLegacyInstallAllowedWindow,  _
													newLegacyPostponeInstall,  _
													newLegacyProgramFlags, 	_
													newLegacyRebootCountdown,  _
													newLegacySilentInstall)


	' Get the specific SMS_UpdatesAssignment instance to modify.
	Set assignmentToModify = connection.Get("SMS_UpdatesAssignment.AssignmentID=" & existingAssignmentID & "")  

	' Set the new property values.
	' Values needed for only for SMS 2003 interop.
	assignmentToModify.LegacyAdvertFlags = newLegacyAdvertFlags
	assignmentToModify.LegacyCollectInventory = newLegacyCollectInventory
	assignmentToModify.LegacyDependentProgram = newLegacyDependentProgram
	assignmentToModify.LegacyDeploymentEnabled = newLegacyDeploymentEnabled
	assignmentToModify.LegacyDeploymentSchedule = newLegacyDeploymentSchedule
	assignmentToModify.LegacyDPLocality = newLegacyDPLocality
	assignmentToModify.LegacyForceReboot = newLegacyForceReboot
	assignmentToModify.LegacyInstallAllOnDeadline = newLegacyInstallAllOnDeadline
	assignmentToModify.LegacyInstallAllowedWindow = newLegacyInstallAllowedWindow
	assignmentToModify.LegacyPostponeInstall = newLegacyPostponeInstall
	assignmentToModify.LegacyProgramFlags = newLegacyProgramFlags
	assignmentToModify.LegacyRebootCountdown = newLegacyRebootCountdown
	assignmentToModify.LegacySilentInstall = newLegacySilentInstall

	' Save the property changes.
	assignmentToModify.Put_ 

	' Output success message.
	Wscript.Echo "Configured deployment: " & existingAssignmentID

End Sub
C#  Copy Code
public void ConfigureSUMDeploymentPropertiesRequiredforInteroperability (WqlConnectionManager connection,
															 int existingAssignmentID,
															 int newLegacyAdvertFlags,
															 bool newLegacyCollectInventory,
															 string newLegacyDependentProgram,
															 bool newLegacyDeploymentEnabled,
															 string newLegacyDeploymentSchedule, 														 
															 int newLegacyDPLocality,
															 bool newLegacyForceReboot,
															 bool newLegacyInstallAllOnDeadline,
															 int newLegacyInstallAllowedWindow,
															 bool newLegacyPostponeInstall,
															 int newLegacyProgramFlags,
															 int newLegacyRebootCountdown,
															 bool newLegacySilentInstall)
{
	try
	{
		// Get the specific SMS_UpdatesAssignment instance to change.
		IResultObject updatesAssignmentToChange = connection.GetInstance(@"SMS_UpdatesAssignment.AssignmentID=" + existingAssignmentID);

		// Set the interoperability properties.
		updatesAssignmentToChange ["LegacyAdvertFlags"].IntegerValue = newLegacyAdvertFlags;
		updatesAssignmentToChange ["LegacyCollectInventory"].BooleanValue = newLegacyCollectInventory;
		updatesAssignmentToChange ["LegacyDependentProgram"].StringValue = newLegacyDependentProgram;
		updatesAssignmentToChange ["LegacyDeploymentEnabled"].BooleanValue = newLegacyDeploymentEnabled;
		updatesAssignmentToChange ["LegacyDeploymentSchedule"].StringValue = newLegacyDeploymentSchedule;
		updatesAssignmentToChange ["LegacyDPLocality"].IntegerValue = newLegacyDPLocality;
		updatesAssignmentToChange ["LegacyForceReboot"].BooleanValue = newLegacyForceReboot;
		updatesAssignmentToChange ["LegacyInstallAllOnDeadline"].BooleanValue = newLegacyInstallAllOnDeadline;
		updatesAssignmentToChange ["LegacyInstallAllowedWindow"].IntegerValue = newLegacyInstallAllowedWindow;
		updatesAssignmentToChange ["LegacyPostponeInstall"].BooleanValue = newLegacyPostponeInstall;
		updatesAssignmentToChange ["LegacyProgramFlags"].IntegerValue = newLegacyProgramFlags;
		updatesAssignmentToChange ["LegacyRebootCountdown"].IntegerValue = newLegacyRebootCountdown;
		updatesAssignmentToChange ["LegacySilentInstall"].BooleanValue = newLegacySilentInstall;
	
		// Save the property changes.
		updatesAssignmentToChange.Put();

		// Output success message.
		Console.WriteLine("Set deployment " + existingAssignmentID + " with properties required for interoperability.");
}

	catch (SmsException ex)
	{
		Console.WriteLine("Failed to update deployment properties.  Error: " + ex.Message);
		throw;
}
}

The following example method has the following parameters:

Parameter

Type

Description

connection

  • Managed: WqlConnectionManager

  • VBScript: SWbemServices

A valid connection to the SMS Provider.

existingAssignmentID

  • Managed: integer

  • VBScript: integer

An existing assignment ID to modify.

newLegacyAdvertFlags

  • Managed: integer

  • VBScript: integer

A new legacy advert flags setting.

newLegacyCollectInventory

  • Managed: Boolean

  • VBScript: Boolean

A new legacy collect inventory setting.

newLegacyDependentProgram

  • Managed: String

  • VBScript: String

A new legacy dependent program setting.

newLegacyDeploymentEnabled

  • Managed: Boolean

  • VBScript: Boolean

A new legacy deployment enabled setting.

newLegacyDeploymentSchedule

  • Managed: String

  • VBScript: String

A new legacy deployment schedule.

newLegacyDPLocality

  • Managed: Integer

  • VBScript: Integer

A new legacy distribution point locality setting.

newLegacyForceReboot

  • Managed: Boolean

  • VBScript: Boolean

A new legacy force reboot setting.

newLegacyInstallAllOnDeadline

  • Managed: Boolean

  • VBScript: Boolean

A new legacy install all on deadline setting.

LegacyInstallAllowedWindow

  • Managed: Integer

  • VBScript: Integer

A new legacy install allowed window setting.

newLegacyPostponeInstall

  • Managed: Boolean

  • VBScript: Boolean

A new legacy postpone install setting.

LegacyProgramFlags

  • Managed: Integer

  • VBScript: Integer

A new legacy program flags setting.

LegacyRebootCountdown

  • Managed: Integer

  • VBScript: Integer

A new legacy reboot countdown setting.

newLegacySilentInstall

  • Managed: Boolean

  • VBScript: Boolean

A new legacy silent install setting.

Compiling the Code

This C# example requires:

Namespaces

System

System.Collections.Generic

System.Text

Microsoft.ConfigurationManagement.ManagementProvider

Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine

Assembly

adminui.wqlqueryengine

microsoft.configurationmanagement.managementprovider

Robust Programming

For more information about error handling, see About Configuration Manager Errors.

Security

For more information about securing Configuration Manager applications, see Securing Configuration Manager Applications.

See Also


Send comments about this topic to Microsoft.