You set the silent mode on a client, in Microsoft System Center Configuration Manager 2007, by creating an instance of the CCMUpdatesDeployment COM Automation Class and by using the SetUserExperienceFlag method.

To set the silent mode on clients

  1. Create a CCMUpdatesDeployment instance by using the CCMUpdatesDeployment COM class.

  2. Set the silent mode by using the SetUserExperienceFlag method.

Example

The following example method shows how to set the silent mode on a client by using the CCMUpdatesDeployment COM class and the SetUserExperienceFlag method.

For information about calling the sample code, see How to Call Configuration Manager COM Automation Objects

Visual Basic Script  Copy Code
Sub SetSilentModeonClient(newUserExperienceFlag)

	' Initialize the updatesDeployment variable.
	dim updatesDeployment

	' Create the COM object.
	set updatesDeployment = CreateObject ("UDA.CCMUpdatesDeployment")

	' Set silent mode on the client by using the SetUserExperienceFlag method
	' and the newUserExperienceFlag (set with a value of 2) passed in.
	updatesDeployment.SetUserExperienceFlag newUserExperienceFlag

	' Output success message.
	wscript.echo "Set Silent Mode."

End Sub
C#  Copy Code
public void SetSilentModeonClients(uint newUserExperienceFlag)
{
	try
	{
		// Create the UpdatesDeployment instance.
		UPDATESDEPLOYMENTLib.CCMUpdatesDeploymentClass newCCMUpdatesDeployment = new UPDATESDEPLOYMENTLib.CCMUpdatesDeploymentClass();

	 // Set silent mode on the client by using the SetUserExperienceFlag method
	 // and the newUserExperienceFlag (set with a value of 2) passed in.
		newCCMUpdatesDeployment.SetUserExperienceFlag(newUserExperienceFlag);

		// Output a success message.
		Console.WriteLine("Ran SetUserExperience.");
}

	catch (COMException ex)
	{
		Console.WriteLine("Failed to run SetUserExperience method. Error: " + ex.Message);
		throw;
}

}

The example method has the following parameters:

Parameter

Type

Description

newUserExperienceFlag

  • Managed: Integer

  • VBScript: Integer

The value to set the user experience flag. This value determines the user experience mode that determines what is displayed and how software updates are received and installed on a target computer.

Possible user experience mode values are:

0 - DEFAULT (per policy)

1 - INTERACTIVE

2 - QUIET

Compiling the Code

This C# example requires:

Namespaces

System

System.Runtime.InteropServices

UPDATESDEPLOYMENTLib COM Automation Library

COM Automation

The reference that is needed for early binding is UpdatesDeploymentAgent 1.0 Type Library. This creates a type library reference named UPDATESDEPLOYMENTLib. The early binding object name for the Control Panel Manager is CCMUpdatesDeploymentClass.

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.