Wednesday, May 11, 2016

Use SCCM to Query WMI (Hardware or OS information)



One of the best features of SCCM is the query function. They didn't cover it when I took the class but this can make your day.

Step 1 - The setup:

In Administration > Client Settings > Default Client Settings (or wherever) > Properties

 

Select Hardware Inventory > Set Classes...


These are essentially WMI classes. You should at least pick:


Picking these will let you write queries for software installed on machines. There are thousands of pieces of information in there. If you ever need data collected from your OS or hardware this should be first place to check. You can also get custom MOF files to collect information not in WMI or specific to your hardware from vendors.


Step 2 - Writing the Query:

Once the inventory has ran... You can query it.

Go to Monitoring > Queries > Create Query


Name it then click edit query statement


Now in edit query statement click the sun? button highlighted in yellow below



Select how you want it sorted. Then press Select....



Add The System Resource attribute Name



The result should be something like this



Now comes the fun part add additional criteria by clicking the Sun? (New) button and following the same steps to add almost any WMI class you want.



Hold on! I don't have local admins that would so useful for auditing! I know right... Follow this blog post and you will. https://blogs.technet.microsoft.com/sudheesn/2014/12/12/collect-hardware-inventory-of-local-admins/





No comments:

Post a Comment