ConfigMgr WMI Query ‘Not’ Statement

I had a scenario on client site to ensure the ‘Disable Bitlocker’ Action did not run for Virtual Machines. I did not have the MDT Toolkit running ‘In OS’ therefore I could not pull in the ‘IsVM’ variable therefore I wanted to exclude based on retrievable attributes from WMI.

Instead of the normal ‘like’ statements I used the below which you could adapt:

SELECT * FROM Win32_ComputerSystem WHERE NOT Model LIKE “%VMware Virtual Platform%”

SELECT * FROM Win32_ComputerSystem WHERE NOT Model LIKE “%Virtual Machine%”

For me this covered both VMware and Hyper-V virtual machines.

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *