You are on page 1of 2

A Cup of IT: SCCM WQL Query: Dealing with X86 and X64 Systems

SCCM WQL Query: Dealing with X86 and X64 Systems



This one actually comes by request in the comments section of a previous post. I haven't bothered
to post on this subject because I was of the opinion that plenty of other blogs had already covered
this scenario. However, you asked so I suppose it doesn't hurt to go over how I address OS
Architecture in my WQL queries. As with my WQL queries for Windows 8-2012 I just create a
series of basic core queries that I then just "tweak" to fit my needs. Here they are:

Basic "OS Architecture" Queries (returns All Systems for specified architecture):

select distinct
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from
SMS_R_System
inner join
SMS_G_System_COMPUTER_SYSTEM on
SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceID
where
SMS_G_System_COMPUTER_SYSTEM.SystemType = "x86-based PC"

select distinct
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from
SMS_R_System
inner join
SMS_G_System_COMPUTER_SYSTEM on
SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceID
where
SMS_G_System_COMPUTER_SYSTEM.SystemType = "X64-based PC"

OS Architecture Queries filtered by OS Type (Client/Server):



Note how we look for any systems that are NOT servers to get our list of clients.

select distinct
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from
SMS_R_System
inner join
SMS_G_System_COMPUTER_SYSTEM on
SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceID
inner join
SMS_G_System_OPERATING_SYSTEM on
SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceID

where
SMS_G_System_COMPUTER_SYSTEM.SystemType = "x86-based PC" and
SMS_G_System_OPERATING_SYSTEM.Caption not like "%Server%"

http://www.acupofit.com/2014/05/sccm-wql-query-dealing-with-x86-and-x64.html[7/7/2015 18:40:37]
A Cup of IT: SCCM WQL Query: Dealing with X86 and X64 Systems

select distinct
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from
SMS_R_System
inner join
SMS_G_System_COMPUTER_SYSTEM on
SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceID
inner join
SMS_G_System_OPERATING_SYSTEM on
SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceID

where
SMS_G_System_COMPUTER_SYSTEM.SystemType = "x64-based PC" and
SMS_G_System_OPERATING_SYSTEM.Caption like "%Server%"

OS Architecture Queries filtered by OS Version:

select distinct
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from
SMS_R_System
inner join
SMS_G_System_COMPUTER_SYSTEM on
SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceID
inner join
SMS_G_System_OPERATING_SYSTEM on
SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceID

where
SMS_G_System_COMPUTER_SYSTEM.SystemType = "x86-based PC" and
SMS_G_System_OPERATING_SYSTEM.Caption like "%Windows 7%"


In the above code just specify desired OS Architecture for
"SMS_G_System_COMPUTER_SYSTEM.SystemType" and substitute desired OS version for
"SMS_G_System_OPERATING_SYSTEM.Caption". For example:

Use "%2000%" for Windows 2000


Use "%Windows XP%" for Windows XP
Use "%Server 2003%" for Windows 2003
Use "%Vista%" for Windows Vista
Use "%Serverr 2008%" for Windows 2008 Non-R2 (No, the extra "r" is not a typo)
Use "%Windows 7%" for Windows 7
Use "%Server 2008 R2%" for Windows Server 2008 R2
Use "%Windows 8%" for Windows 8
Use "%Server 2012%" for Windows 2012


Hope you guys find this useful, and if anyone knows a betetr method feedback is always welcome.


Posted by
ZeusABJ
at
3:50 PM

Recommend this on Google



Labels:
Query,
SCCM,
WQL

http://www.acupofit.com/2014/05/sccm-wql-query-dealing-with-x86-and-x64.html[7/7/2015 18:40:37]

You might also like