WMI Filters in Group Policy (especially for Vista machines)

I had to do a Group Policy modeling for new Wireless settings (uses Certificates and PEAP) for Windows XP and Vista based machines. Obviously Vista OS have to have  a different Wireless Group Policy. I decided to use WMI filters  to filter out Vista machines and started digging. The following are the links where I found some information:

HOWTO: Leverage Group Policies with WMI Filters

Applying WMI Filters

Filtering out Windows XP machines is easy. The following WMI query is a easy answer.

Select * from Win32_OperatingSystem where Caption = "Microsoft Windows XP Professional"

Well what about Windows Vista machines. Oh! Only Troubles!!! For Vista machines, the Caption is stored as "Microsoft Windows Vista® Business" for Business edition. Applying the same WMI query as above doesn’t work.

Select * from Win32_OperatingSystem where Caption = "Microsoft Windows Vista® Business"

I would do this. Apply Vista Group Policy to all NON-XP machines. Yeah! that might work. After little reading, that will not work. Because Windows 2000 machines are not checked with WMI filter. I certainly don’t want my Vista policy to be applied in Windows 2000 machine.

Then I decided to go with OS version number, it didn’t quite work out as I expected. OS version number changes if we apply  a new service pack. That’s not a good idea. But somehow I know I can tweak the query to check only the high version number (e.g, 6 for Vista, 6.0.5724 is the full version number)

Then I found this blog:

How to detect Vista and Longhorn with WMI Filters

So my WMI query for Vista machines are (as it is from the above link),

SELECT Version, ProductType FROM Win32_OperatingSystem WHERE Version >= ‘6’

Voila! It worked. So I created, tested and applied the Wireless GPO for Vista machines in production.

My ONLY fear is Microsoft doesn’t change things in next service pack that affects my current WMI query.


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