Disease Posted February 27, 2018 Posted February 27, 2018 (edited) Hi I am trying to create a device collection for production clients and development clients based on OS and OU membership but can not really seem to get it to work. I am using the following syntax to build a collection of machines that have workstation os on them and are in our test computer OU: 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 "%Microsoft Windows NT Workstation 6.1%" or SMS_R_System.OperatingSystemNameandVersion like "%Microsoft Windows NT Workstation 6.3%" or SMS_R_System.OperatingSystemNameandVersion like "%Microsoft Windows NT Workstation 10.0%" and SMS_R_System.SystemOUName like "STEDMUNDS.LOCAL/COMPUTERS OU/TEST LABS" This just seems to return all the workstatios not just the ones in the test OU. ( as a note I tried all flavors, equal to, not equal to etc.) Any ideas? Thanks Edited February 27, 2018 by Disease
Steve21 Posted February 27, 2018 Posted February 27, 2018 Your "or" is countering it and effectively making it like it's one or the other. Did you mean to use basically any 6.1/6.3/10.0 that are in the test ou? Will rewrite it out Steve 1
Disease Posted February 27, 2018 Author Posted February 27, 2018 This would be the top level collection to pull all workstation OS from a Test lab OU, then I would create a separate collection based on specific OS using the Top level collection as the limiting collection, it's for windows update.
Steve21 Posted February 27, 2018 Posted February 27, 2018 If you want all workstations (e.g. not servers) ignore the specific OS and just do it like this 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%" and SMS_R_System.SystemOUName = "STEDMUNDS.LOCAL/COMPUTERS OU/TEST LABS" Steve 1
Disease Posted February 27, 2018 Author Posted February 27, 2018 (edited) Brill that worked a treat, thanks now just got to get the Production one working where it pulls all workstation except the ones in that OU Edited February 27, 2018 by Disease
Steve21 Posted February 27, 2018 Posted February 27, 2018 Either the same query with a not OU or just do a workstation query and then use the exclude collection option and put the test one as an exclude on it Steve 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now