Batch file kickoff of multiple clients requiring HW inventory

Having issues with hardware inventory in running on the machines ,there are several tools that does this job like Right click tools ,SMS collection commander from  Zander and can use batch script given below.

1.Cretea a folder called Temp in C drive.

2.Crete a new notepad file ,add list of computers that you want to kick the hinv on and save it as Computerlist.txt in c:\Temp folder.

3.Open a notepad and paste the below code and save it as filename.bat .

@echo off
REM It kickoffs the hinv on to the list of machines provided
WMIC /node:@c:\temp\Computerlist.txt /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000001}”

4.double click the filename.bat file and it should trigger the hinv on the list of machines that you have proivded in the notepad list.

 

since the above script is created  to trigger hardware inventory action,You will have all the Actions ID given below for each.

 

    • Hardware Inventory – 00000000-0000-0000-0000-000000000001
    • Software Inventory – 00000000-0000-0000-0000-000000000002
    • Data Discovery – 00000000-0000-0000-0000-000000000003
    • Machine Policy Assignment Request – 00000000-0000-0000-0000-000000000021
    • Machine Policy Evaluation – 00000000-0000-0000-0000-000000000022
    • Refresh Default Management Point – 00000000-0000-0000-0000-000000000023
    • Refresh Location (AD site or Subnet) – 00000000-0000-0000-0000-000000000024
    • Software Metering Usage Reporting – 00000000-0000-0000-0000-000000000031
    • Source list Update Cycle – 00000000-0000-0000-0000-000000000032
    • Refresh proxy management point – 00000000-0000-0000-0000-000000000037
    • Cleanup policy – 00000000-0000-0000-0000-000000000040
    • Validate assignments – 00000000-0000-0000-0000-000000000042
    • Certificate Maintenance – 00000000-0000-0000-0000-000000000051
    • Branch DP Scheduled Maintenance – 00000000-0000-0000-0000-000000000061
    • Branch DP Provisioning Status Reporting – 00000000-0000-0000-0000-000000000062
    • Software Update Deployment – 00000000-0000-0000-0000-000000000108
    • State Message Upload – 00000000-0000-0000-0000-000000000111
    • State Message Cache Cleanup – 00000000-0000-0000-0000-000000000112
    • Software Update Scan – 00000000-0000-0000-0000-000000000113
    • Software Update Deployment Re-eval – 00000000-0000-0000-0000-000000000114
    • OOBS Discovery – 00000000-0000-0000-0000-000000000120

 

You can see all the above actions item IDs from WMI. From Run command,type wbemtest and use the name space as ‘root\CCM\Policy\Machine‘. It list all the classes (Dynamic or Static from WMI Repository).

 

 Hope it Helps !


Post Comment