Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

NEW 2012 collection query to exclude names

  • Thread starter Thread starter WarBear3000
  • Start date Start date
  • Replies Replies 0
  • Views Views 5K

WarBear3000

New Member
Messages
1
Reaction score
0
Points
1
SCCM 2012 R2 SP1 CU3
For some reason my Collection query is not excluding my Test pc's. Like Test01, Test02, Test03 etc.

In this collection I want it to show ONLY windows 7 and windows 10 workstations but Exclude machines that have a system name of "Test%". It's including all windows 7 and 10 computers, but not excluding the test names:

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 "%Workstation 6.1%" or SMS_R_System.OperatingSystemNameandVersion like "%Workstation 10.0%" and SMS_R_System.Name != "Test%"

I also tried
and SMS_R_System.Name not like "Test%"

I also tried
and SMS_R_System.Name not like "%Test%"

but I must be missing something.
 

Forum statistics

Threads
7,135
Messages
27,868
Members
18,159
Latest member
jordysmits
Back
Top