In Microsoft System Center Configuration Manager 2007, you view the Configuration Manager 2007 software distribution advertised programs client agent settings by using the resource manager (UIResourceMgrClass) object GetSWDistSettings method.

To view the software distribution advertised programs client agent settings

  1. Get the Configuration Manager client resource manager object (UIResourceMgrClass).

  2. From the UIResourceMgrClass object, call GetSWDistSettings to get the client's software distribution settings.


The following example method gets the Configuration Manager client software distribution agent settings.

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

Visual Basic Script  Copy Code
Sub AgentSettings

	On Error Resume Next

	Dim oUIResManager 
	Dim oSWDist 

	Set oUIResManager = createobject("UIResource.UIResourceMgr")

	If oUIResManager Is Nothing Then
		Wscript.Echo "Couldn't create Resource Manager - quitting"
		Exit Sub
	End If

	Set oSWDist=oUIResManager.GetSWDistClientSettings()

	If oSWDist Is Nothing Then
		Set oUIResManager=Nothing
		Wscript.Echo "Couldn't get software distribution information - quitting"
		Exit Sub
	End If

	Wscript.Echo "Program countdown duration:   " & FormatNumber (oSwDist.UserPreemptionCountdown,0) & " seconds"
	Wscript.Echo "User input timeout:		 " & FormatNumber (oSwDist.UserPreemptionTimeout/60,0) & " minutes"
	Wscript.Echo "Content Location Timeout:	 " & FormatNumber (oSwDist.ContentLocationTimeout,0) & " seconds"

	If oSwDist.DisplayNewProgramNotification=1 Then
		Wscript.Echo "New program notification:	 Enabled"
		Wscript.Echo "New program notification:	 Disabled"
	End if

	If oSWDist.SWDistEnabled=1 Then
		Wscript.Echo "Software distribution:		Enabled"
		Wscript.Echo "Software distribution:		Disabled"
	End if

	Wscript.Echo "What's new dialog duration:   " & FormatNumber (oSwDist.WhatsNewDuration,0) & " seconds"

	Set oSWDist=Nothing 
	Set oUIResManager=Nothing

End Sub
C#  Copy Code
public void AgentSettings()
	UIResourceMgrClass uiResMgr = new UIRESOURCELib.UIResourceMgrClass();

	SWDistClientSettings swDistSettings = uiResMgr.GetSWDistClientSettings();

	Console.WriteLine("Program countdown duration:   " + swDistSettings.UserPreemptionCountdown.ToString() + " seconds");
	Console.WriteLine("User input timeout:		 " + (swDistSettings.UserPreemptionTimeout/60).ToString() +  " minutes");
	Console.WriteLine("Content Location Timeout:	 " + swDistSettings.ContentLocationTimeout.ToString() + " seconds");

	if (swDistSettings.DisplayNewProgramNotification==1)
		Console.WriteLine("New program notification:	 Enabled");
		Console.WriteLine("New program notification:	 Disabled");

	if (swDistSettings.SWDistEnabled == 1)
		Console.WriteLine("Software distribution:		Enabled");
		Console.WriteLine("Software distribution:		Disabled");

	Console.WriteLine("What's new dialog duration:   "  + swDistSettings.WhatsNewDuration.ToString() + " seconds");


The example method has no parameters.

Compiling the Code

This C# example requires:







COM Reference

UIResource 1.0 Type Library

Robust Programming

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


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

See Also

Send comments about this topic to Microsoft.