ConfigMgr and/or MDT – Useful WMI Queries and WMI Tools
Wanted to post a blog entry with typical WMI “backend” queries for limiting Task Sequence steps. My intention is to update this as I find more queries that we use. I’m going under the assumption that you know where to use this query, so I won’t be showing any examples or screenshots or instructions on using this with a Task Sequence step/variable.
Keep in mind that you can find out information you can query by using WMIC. Common usage for model/driver type queries would be pulling information from CSPRODUCT, aka “WMIC CSPRODUCT” or “WMIC CSPRODUCT GET NAME”.
Here is a chart of info for queries.
http://blogs.1e.com/index.php/2009/09/23/wmic-aliaswmi-class-mapping/
WMI Tools from Microsoft gives you CIM Studio and Object Browser which are great for browsing WMI information to see possible properties to query. Or you can always use “wbemtest” to enumerate classes.
Microsoft WMI Tools
Sample Queries
I pretty much always use a LIKE statement with variables. In the world of HP model #’s, or other manufacturers, you don’t want to have 10 queries for the same model, variables eliminate the need for multiple queries, you can also do OR statements, but again I feel it’s easier to accomplish with a variable.
Query for Hardware ID:
SELECT * FROM Win32_PnPEntity WHERE DeviceID like 'PCI\\VEN_8086&DEV_2822%'
Example usage is querying for the hardware ID of a video card that might be on multiple systems. You might want to tie a driver package to this step and only apply the driver package when the video card is detected. Useful if the card is installed in various models.
Query for Version:
Select * from Win32_ComputerSystemProduct where Version like"%T61%"
Query for Model:
SELECT * FROM Win32_ComputerSystem WHERE Model LIKE "%2765T6U%"