Reporting
Hi,
I'm currently building LAB to OS deployment using SCCM. It works nice.But I have one problem, when I run report "Status Summary of a specific task sequence advertisement", I only get "No Status" in Execution State.
Any hints?
P.S.Do we have any documents about managing SCCM using WMI. I would like to use PowerShell to populate specific variables for every computer.In a way Branch Office Deployment (2004) guide uses ADS.
December 23rd, 2007 2:31pm
Hi,
By default, the summarization is scheduled to run every hour. You can force it to run by using the Run Homepage Summarization action on the Operating System Deployment node and then refreshing the view. If you still dont see any results then please check the History - Specific task sequence advertisements run on a specific computer report to see if we are actually getting status messages.
We are currently working on the SDK documentation. It will have information on how to programmatically control OSD objects. Here is a script I have to set a machine variable:
Code Block
'
' Utility to manage machine variables
' Usage:
' CScript MachineVar.vbs <resourceid>
' CScript MachineVar.vbs <resourceid> <var> <value>
'
' Verify We have at least one arg
IF WScript.Arguments.Count < 1 OR WScript.Arguments.Count > 4 THEN
WScript.Echo "CScript MachineVar.vbs <resourceid>"
WScript.Echo "CScript MachineVar.vbs <resourceid> <var> <value> [<masked>]"
WScript.Quit 1
END IF
' Connect to the SMS namespace
SET siteProvider = GetSiteProvider()
WScript.Echo "Namespace = "&siteProvider.NamespacePath
SET objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!"&_
siteProvider.NamespacePath)
' Read the params
sResourceID = WScript.Arguments.Item(0)
' Get the machine object
ON ERROR RESUME NEXT
DIM machineSettings
SET machineSettings = objWMIService.Get("SMS_MachineSettings.ResourceID='"&_
sResourceID&"'")
' If an instance of SMS_MachineSettings has not yet been created
' error -2147217406 (Object not found) is returned.
IF Err.Number = -2147217406 THEN
' Clear the error
Err.Clear
ON ERROR GOTO 0
' Create an instance of SMS_MachineSettings.
SET machineSettings = objWMIService.Get("SMS_MachineSettings").SpawnInstance_()
' Set the properties of SMS_MachineSettings.
machineSettings.ResourceID = sResourceID
machineSettings.SourceSite = siteProvider.SiteCode
' Save the instance created.
machineSettings.Put_
' Reget the instance
SET machineSettings = objWMIService.Get("SMS_MachineSettings.ResourceID='"&_
sResourceID&"'")
END IF
ON ERROR GOTO 0
' Print out the machine variables
WScript.Echo "Variables for machine "&sResourceID
FOR EACH var IN machineSettings.MachineVariables
IF var.IsMasked = true THEN
WScript.Echo " "&var.Name & " = "&var.value
ELSE
WScript.Echo " "&var.Name & " = " & var.value
END IF
NEXT
' If user asked us to set a value
IF WScript.Arguments.Count > 1 THEN
' Read in name and value
sVarName = WScript.Arguments.Item(1)
sVarValue = WScript.Arguments.Item(2)
' Read masked flag
bIsMasked = false
IF WScript.Arguments.Count > 3 THEN
IF WScript.Arguments.Item(3) = "true" THEN
bIsMasked = true
END IF
END IF
' Declare new array for machine vars
numMachineVars = UBOUND(machineSettings.MachineVariables)
REDIM NewMachineVar( numMachineVars+1 )
' Copy existing values
FOR i = LBOUND(machineSettings.MachineVariables) TO _
UBOUND(machineSettings.MachineVariables)
SET NewMachineVar(i) = machineSettings.MachineVariables(i)
NEXT
' Copy in new values
SET NewMachineVar( numMachineVars+1 ) = _
objWMIService.Get("SMS_MachineVariable").SpawnInstance_()
NewMachineVar( numMachineVars+1 ).Name=sVarName
NewMachineVar( numMachineVars+1 ).Value=sVarValue
NewMachineVar( numMachineVars+1 ).IsMasked=bIsMasked
' Apply changes
machineSettings.MachineVariables = NewMachineVar
machineSettings.Put_
WScript.Echo "Successfully set "&sVarName&"."
END IF
'
' Utility function to search for the site provider
'
FUNCTION GetSiteProvider()
' Find SMS Provider
DIM SiteProvider
WScript.Echo "Searching for SMS Provider for local site..."
SET objSMSNamespace = GetObject("winmgmts:{impersonationLevel=impersonate}"&_
"!\\.\root\sms")
SET results = objSMSNamespace.ExecQuery("SELECT * From SMS_ProviderLocation "&_
"WHERE ProviderForLocalSite = true")
' Process the results
FOR EACH r in results
SET SiteProvider = r
NEXT
' Fail if we did not find the site
IF SiteProvider.NamespacePath = "" THEN
WScript.Echo "Failed to locate SMS provider."
WScript.Quit 1
END IF
' Return
SET GetSiteProvider = SiteProvider
END FUNCTION
-- Brett
Free Windows Admin Tool Kit Click here and download it now
December 26th, 2007 9:47pm
Hi,
thanks for help. But I still can't get any status messages.
I have run "Run Homepage Summarization but without success
Also I can't run report "History - Specific task sequence advertisements run on a specific computer because when I select values for computer name it returns me empty list
As for setting variables this is working just right
Krunoslav
December 27th, 2007 5:03pm
4 years later and it's still not fixed. probably never going to be fixed as 2012 is on it's way.nick
Free Windows Admin Tool Kit Click here and download it now
December 13th, 2011 11:50am