While working on-site with a customer and a Microsoft SCCM Technical Consultant, I was shown a great capability in the OS to force the SCCM client agent to check its AMT auto-provisioning policy at will.
The Windows OS ships with a utility called Windows Management Instrumentation Tester that can be used to force the SCCM agent to check its AMT Auto-Provisioning Policy (standard WMI calls). The following steps show this manual method that you can perform with this utility, either locally or remotely, to force this check. By default the SCCM server's site control file sets the agent check to automatically run every 24 hours. However, in a lab or testing environments this 24 hour default cycle is not convenient. With these steps below, you can execute this check at will or even use while troubleshooting issues. To perform these steps, you must have administrative privileges on the target OS.
After the manual steps listed below, Matt Royer has provided a reference to a .vbs file that performs these steps to help automate the process. Feel free to use these steps and scripts for your environment. And if you find new and/or improved methods with these WMI calls, please post for others to learn from.
Manual Steps to issue WMI command:
|
|
|
|
|
|
|
|
|
|
|
|
To perform these steps automatically through a .vbs script:
All you need to do is run the following command:
cscript sendsched.vbs {00000000-0000-0000-0000-000000000120} <target vpro machine name with sccm client>
sendsched.vbs is piece of code included in the SMS 2003 Toolkit: http://technet.microsoft.com/en-us/sms/bb676787.aspx
00000000-0000-0000-0000-0000 00000120 is the scheduled ID for auto-provisioning policy.
This is defiantly a good find Bill. The SendSched.vbs can be used in a variety of different ways.
For example, you could enumerate a sccm collection and execute SendSched against each client in that collection.
Code vbscript BeginConst SMSSITECODE = "VPD" 'SMS Site Code
Const SMSSERVER = "SCCMSP1.vprodemo.com" 'SMS Site Server
Const SMSCollection = "SMS00001" 'SMS Collection ID to enumerate clients from
Set objLocation = CreateObject("WbemScripting.SWbemLocator")
Set WbemServices = objLocation.ConnectServer(SMSSERVER, "root\SMS\site_" & SMSSITECODE)
Set colMembers = wbemServices.ExecQuery("Select * From SMS_FullCollectionMembership WHERE COllectionID='" & SMSCollection & "'")
Set wshShell = WScript.CreateObject("WSCript.shell")
For Each colMember in colMembers
runScript = "cscript sendsched.vbs {00000000-0000-0000-0000-0000-00000120} " & colMember.name
set oExec = wshShell.Exec(runScript)
Do While oExec.Status = 0
WScript.Sleep 1000
Loop
Next
Set wshShell = Nothing
Set WbemServices = Nothing
Set objLocation = Nothing
Code EndAnother option may be to create an sccm advertisement to execute the SendSched locally on the client. Just set up a Command Line Task Sequence using cscript sendsched.vbs {00000000-0000-0000-0000-0000 00000120} and advertise that task sequence to a particular collection.
--Matt Royer