Wscript.Echo objSWbemInst.ClientComponentName Wscript.Echo "Properties - Before Change" ' Display SWD client agent settings before change Set objSWbemInst = swbemServices.Get("SMS_SCI_ClientComp.Filetype=1,Itemtype='Client Component',Sitecode='" & siteToChange & "',ItemName='Software Distribution'",, swbemContext) SwbemServices.ExecMethod "SMS_SiteControlFile.Filetype=1,Sitecode=""" & siteToChange & """", "Refresh",, , swbemContext ' Load site control file and get SWD client component section. Sub EnableDisableSWDClientAgent(swbemServices, swbemContext, enableDisableFlag, siteToChange )
#HOW TO DISABLE MS AGENT SOFTWARE#
The following example method queries for the specific site control file item, software distribution client component section, and changes the flag value to enable or disable the client agent.įor information about calling the sample code, see Calling Configuration Manager Code Snippets. Make a connection to the software distribution client component section of the site control file by using the SMS_SCI_ClientComp class.Īdjust the client agent settings by setting the flag value to 0 to disable the agent or 1 to enable the agent.Ĭommit the property changes to the site control file. For more information, see SMS Provider fundamentals. You can cause significant damage to a site by changing some configurable items. These classes manage the site control file itself. You should use caution or avoid using the SMS_SCI_FileDefinition and SMS_SCI_SiteDefinition classes altogether. You should be experienced in managing a site's configuration before using the SMS Provider classes to modify the site configuration.