This script demonstrates how to determine whether the SMS Advanced Client Software Distribution agent is enabled.
The SWDistClientSettings.SWDistEnabled property determines the agent status by using the following values:
- 0—Software Distribution agent is not enabled.
- 1—Software Distribution agent is enabled.
Example
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" Wscript.Quit end if set oSWDist=oUIResManager.GetSWDistClientSettings() if oSWDist is nothing then set oUIResManager=nothing wscript.echo "Couldn't get software distribution information - quitting" Wscript.Quit end if if oSWDist.SWDistEnabled=1 then wscript.echo "Software distribution: Enabled" else wscript.echo "Software distribution: Disabled" end if set oSWDist=nothing set oUIResManager=nothing |
Compiling the Code
- Requires an SMS 2003 Advanced Client.