SCCM Configmgr 2012 script to Trigger Machine policy inventory and other actions on Clients

In SCCM 2007 ,to initiate machine policy /hardware inventory and other actions on client,we use vb script/wmic/Powershell/Right click Tools and other tools like Client center,collection commander etc.Some organizations do not like to install any of these tools.In that cases,we have only option of using scripts. to achive it

The most common Script that is used to trigger policy agent on SCCM 2007 clients remotely is blogged here

In Configuration Manager 2012,we have something called fast channel (Client notification) to download Machine Policy.

At times,you see some weired issues with sccm clients with respect to hardware inventory and they never get updated with right inventory because of its previous inventory (deltas) though you see inventory is successful from inventoryagent.log

How do we perform full hardware inventory on configmgr client ? The Script attached here does removal of hinv action item from wmi and try to force hardware inventory cycle. For more information about hardware inventory troubleshooting,refer

The below VB script is written to Trigger Hardware inventory agent on clients:

'Declare Variables
On Error Resume Next
Set sho = CreateObject("WScript.Shell")
strSystemRoot = sho.expandenvironmentstrings("%SystemRoot%")
strCurrentDir = Left(Wscript.ScriptFullName, (InstrRev(Wscript.ScriptFullName, "\") -1))
' Get a connection to the "root\ccm\invagt" namespace (where the Inventory agent lives)
Dim oLocator
Set oLocator = CreateObject("WbemScripting.SWbemLocator")
Dim oServices
Set oServices = oLocator.ConnectServer( , "root\ccm\invagt")
'Reset SMS Hardware Inventory Action to force a full HW Inventory Action
sInventoryActionID = "{00000000-0000-0000-0000-000000000101}"
' Delete the specified InventoryActionStatus instance
oServices.Delete "InventoryActionStatus.InventoryActionID=""" & sInventoryActionID & """"
'Pause 3 seconds To allow the action to complete.
wscript.sleep 3000
'Run a SMS Hardware Inventory
Set cpApplet = CreateObject("CPAPPLET.CPAppletMgr")
Set actions = cpApplet.GetClientActions
For Each action In actions
If Instr(action.Name,"Hardware Inventory Collection") > 0 Then
End If

Note:Replace the quotes used in the script as they converted to fancy quotes.

If you want to run other actions,please replace the ActionID and Action name as given below:

    • Software Metering Usage Report :00000000-0000-0000-0000-000000000106
    • Request & Evaluate Machine Policy :8EF4D77C-8A23-45c8-BEC3-630827704F51
    • Updates Source Scan :00000000-0000-0000-0000-000000000113
    • Request & Evaluate User Policy:3A88A2F3-0C39-45fa-8959-81F21BF500CE
    • Hardware Inventory Collection:00000000-0000-0000-0000-000000000101
    • Software Inventory Collection:00000000-0000-0000-0000-000000000102
    • Application Global Evaluation:00000000-0000-0000-0000-000000000123
    • Software Updates Assignments Evaluation:00000000-0000-0000-0000-000000000108
    • Discovery Data Collection:00000000-0000-0000-0000-000000000103
    • MSI Product Source Update:00000000-0000-0000-0000-000000000107
    • Standard File Collection:00000000-0000-0000-0000-000000000104


To Know How to run this script on remote clients using psexec ? Read blog post

you can download the script from technet Gallary

4 Responses to "SCCM Configmgr 2012 script to Trigger Machine policy inventory and other actions on Clients"

  1. Hello, Does this work if placed towards the end of an OSD task sequence? we need to make sure machines perform full hardware inventory as soon as possible after machines are deployed.

    1. Hi Chris,
      This script is to trigger the existing policies but while doing OSD,client will not have have all actions in WMI,it may take sometime to get the policies from Site if you try to add this script in TS,it cannot trigger the actions which are not available in WMI ,except machines policy and user policy.
      But you can give a try how it works.

    1. Yes,You can do this with Client Center but i have seen in the past that,Client center and other third party tools are not allowed while working with some of the clients. so posted if someone would be interested.


Leave a Reply