Link to home
Start Free TrialLog in
Avatar of llarava
llaravaFlag for Afghanistan

asked on

Need help building a query in Configuration Manager 2012 - We need to get all the Windows 2012/R2 2008/R2 that are not named like ABC

Hi,

We are building a query for a collection. The collection needs to have all the Windows 2008/R2 and Windows 2012/R2 that are but exclude the ones named like OLSREL, CIVOLSREL and OLSLAB

I have the following but I need to adjust the SMS_G_System_SYSTEM.Name like in order to remove all the servers named like ... from the results.

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 inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_R_System.OperatingSystemNameandVersion like "Microsoft Windows NT Server 6.2" and SMS_R_System.OperatingSystemNameandVersion like "Microsoft Windows NT Advanced Server 6.2" and SMS_R_System.OperatingSystemNameandVersion like "Microsoft Windows NT Server 6.3" and SMS_R_System.OperatingSystemNameandVersion like "Microsoft Windows NT Advanced Server 6.3" and SMS_R_System.OperatingSystemNameandVersion like "Microsoft Windows NT Advanced Server 6.1" and SMS_R_System.OperatingSystemNameandVersion like "Microsoft Windows NT Advanced Server 6.0" and SMS_G_System_SYSTEM.Name like "%OLSREL%" and SMS_G_System_SYSTEM.Name like "%CIVOLSREL%" and SMS_G_System_SYSTEM.Name like "%OLSLAB%"
ASKER CERTIFIED SOLUTION
Avatar of yo_bee
yo_bee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial