How to Set the Silent Mode on Clients
Applies To: System Center Configuration Manager 2007, System Center Configuration Manager 2007 R2, System Center Configuration Manager 2007 R3, System Center Configuration Manager 2007 SP1, System Center Configuration Manager 2007 SP2
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
Create a CCMUpdatesDeployment instance by using the CCMUpdatesDeployment COM class.
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
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
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 |
|
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
Concepts
System Center Configuration Manager Software Development Kit
Configuration Manager Software Updates
About Software Updates Client
CPAppletMgr Client COM Automation Class
CCMUpdatesDeployment COM Automation Class
ICCMUpdatesDeployment::SetUserExperienceFlag Method