SCCM WMI Query for NOT LIKE

I thought this was confusing, so I figured if it helps one person it is worth posting!

In order to do a WMI query for items that are NOT of a certain definition (for example, machines models that do not begin with “M”), you may think that you would include “NOT LIKE” in your query. The truth is, your query should look like this:

SELECT * FROM Win32_ComputerSystemProduct WHERE NOT Version LIKE “%M%”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s