Export (0) Print
Expand All

Script Sample for API-Based Triggering of the Product Source Update Manager

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

Several events can occur on the Microsoft System Center Configuration Manager 2007 client that will cause the Product Source Update Manager agent to update source locations for one or more Windows Installer products. Use the following VBScript script to enable a Windows Installer source list update cycle.

Script

' Name of script is updateps.vbs.

dim oSrcList
dim oSrcLocs
dim sLoc

Set objArgs = WScript.Arguments

If objArgs.Count < 1 then
    WScript.echo "Usage: updateps.vbs {Product Code}" 
    WScript.quit
end if


set oSrcList = CreateObject ("SrcUpdateMgr.ProductSourceList")

if oSrcList is nothing then 
    wscript.echo "Could not create Product Source List Object - quitting"
    wscript.quit
end if

oSrcList.UpdateSourceList objArgs(0), FALSE

oSrcLocs = oSrcList.GetSourceList(objArgs(0))

dim nIndex
for nIndex = LBound(oSrcLocs) To UBound(oSrcLocs)
    WScript.echo oSrcLocs(nIndex)
next


WScript.echo "Successfully update source list for product" + objArgs(0)

See Also

For additional information, see Configuration Manager 2007 Information and Support.
To contact the documentation team, email SMSdocs@microsoft.com.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft