SCCM 2012 Device Collection Query

Soldato
Joined
28 Sep 2008
Posts
14,207
Location
Britain
Chaps, trying to knock up a simple query to return all Server devices running a mix of 208R2 and 2012R2.

My query is:

select 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 where SMS_R_System.OperatingSystemNameandVersion like "%Server 6.1%" and SMS_R_System.OperatingSystemNameandVersion like "%Server 6.3%"

The member count remains 0. If I drop out the "and" and just have Server 6.1 or Server 6.3, the membership count updates.

Furthermore, to add to the confusion, the query wizard, if used, allows that query to be built without returning syntax errors.
 
Essentially, how I read it is, server 6.3 and like 6.1. You won't ever have the OS reporting it is 6.3 and it's like 6.1. The syntax is correct but you've created a statement that won't ever have members.

Perhaps an or statement would be better. Or greater than (i.e. greater than 6.0).



M.
 
Last edited:
Back
Top Bottom