WMI Filters - Need to target XP 32 bit and 64 bit only

Posted on 2010-11-11
Last Modified: 2012-05-10

I need to target a group policy at WIndows XP x86 and x64 operating systems only.

The current filter i am using (shown below, seems to only affect the xp 32 bit versions.

select * from Win32_OperatingSystem where Version like "5.1%" and ProductType = "1"

Any ideas?

Question by:ranski
  • 5
  • 4
LVL 57

Expert Comment

by:Mike Kline
ID: 34114561
I haven't tested this

32 bit OS "select * from Win32_Processor where AddressWidth = 32"

64bit OS "select * from Win32_Processor where AddressWidth = 64"

addresswidth reference



Author Comment

ID: 34114747
Hi, this would also apply to windows 7 machines though which I do not want to happen.
LVL 27

Expert Comment

ID: 34115735
Since you can not have to classes in your WMI query you will have to create two separate GPOs or you could use the operatingsystem class you you did but just change it a little

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

select * from Win32_OperatingSystem where Caption = "Microsoft(R) Windows(R) XP Professional x64 Edition"

Using the Processor class like Mike mentioned is the better way of doing this to find x64 or x32 clients. You will want to check the Caption on your computers to make sure they match.

An easy way to check is to use powershell

gwmi -Class Win32_OperatingSystem | FL Caption

Author Comment

ID: 34115771
thanks Ken,
Surelly there must be a way to target them both just using one filter?
LVL 27

Accepted Solution

KenMcF earned 500 total points
ID: 34115861
Wait, I read that wrong. The one you posted looks like it should get all XP computers. I verified those settigns on a x64 version of XP and they were right.

Try this

select * from Win32_OperatingSystem where Caption Like "%XP Professional%"

I have not tested this but will in my lab.
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

LVL 27

Expert Comment

ID: 34115963
XP x64 is version 5.2 not 5.1 that is why your original query did not work.

I tested the previous one I posted and it did work.


Author Comment

ID: 34116151
Really I thought 5.2 was server 2003 when looking here -
But since then i found the below. The key is to make sure you specify that 5.2 is of product type 1, for server you would use 3

select * from Win32_OperatingSystem where (Version like "5.1%" or Version like "5.2%") and ProductType = "1"
The one below that you suggested worked like a charm though.
select * from Win32_OperatingSystem where Caption Like "%XP Professional%"

Thanks very much!

Author Closing Comment

ID: 34116153
much appreciated!
LVL 27

Expert Comment

ID: 34116235
Here is a link to all the version numbers

Author Comment

ID: 34116570
thanks again.

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now