Powershell Tools - Hardware Inventory
Main Menu
>
Tools
>
PowerShell Tools
Hardware Inventory
Force HW inventory on a machine
Download
Code
$SMSCli = [wmiclass] "\\myComputerName\root\ccm:SMS_Client" $SMSCli.TriggerSchedule("{00000000-0000-0000-0000-000000000001}")
Documentation
Here's a brief "How To" for initiating hardware inventory on a remote system using Windows PowerShell. Here it is in simple form: $SMSCli = [wmiclass] "\\myComputerName\root\ccm:SMS_Client" $SMSCli.TriggerSchedule("{00000000-0000-0000-0000-000000000001}") As you can see, in the first line of code we're connecting to the SMS_Client class, in the root\ccm namespace, on the computer named MyComputerName. In the second line of code, we're calling the method TriggerSchedule, with the ScheduleID = {00000000-0000-0000-0000-000000000001}. Review the InventoryAgent.log file on the remote computer to verify hardware inventory ran successfully. As you may know, there are many other ScheduleIDs that can be triggered using this process. Review the ConfigMgr SDK under the section titled TriggerSchedule Method in Class SMS_Client for more information. Here is a table of the most common ScheduleIDs: Name ScheduleID HW Inventory {00000000-0000-0000-0000-000000000001} SW Inventory {00000000-0000-0000-0000-000000000002} Discovery Data Record {00000000-0000-0000-0000-000000000003} Machine Policy Retrieval & Evaluation {00000000-0000-0000-0000-000000000021} File Collection {00000000-0000-0000-0000-000000000010} SW Metering Usage Report {00000000-0000-0000-0000-000000000022} Windows Installer Source List {00000000-0000-0000-0000-000000000032} Software Updates Scan {00000000-0000-0000-0000-000000000113} Software Updates Store {00000000-0000-0000-0000-000000000114} Software Updates Deployment {00000000-0000-0000-0000-000000000108} You can use this command extract a few more ScheduleIDs available to you (yes, four lines for this one command - you should be able to paste into a PowerShell prompt without issue): get-wmiobject CCM_Scheduler_ScheduledMessage ` -namespace root\ccm\policy\machine\actualconfig | select-object ScheduledMessageID, TargetEndPoint | where-object {$_.TargetEndPoint -ne "direct:execmgr"} ---created by: Greg Ramsey