penfold Posted January 20, 2016 Posted January 20, 2016 I'm trying to get a collection which pulls most computers from an OU but I want it to exclude a specific Sub OU where we have some systems which I don't want to pick up some adverts. As a test I've got a test OU and the code I am using is select select 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.SystemOUName = "Domain/TestOU") And (SMS_R_System.SystemOUName <> "Domain/TestOU/2015/2015 Computers") I want it to get all computers under TestOU but exclude the sub OU 2015 Computers. The result of the above seems to show all systems. Can anyone point out where I am going wrong?
penfold Posted January 20, 2016 Author Posted January 20, 2016 Quick update. There was already a collection for the specific "Test Sub OU" for other deployments. What I have done is set the top level "Domain/TestOU" then set an additional rule to exclude "Test Sub OU" collection which seems to work. I've also created a Unhealthly clients collection so any clients which fall into the category of inactivity get put into it. The idea was from here so that I could get reports of deployments which would only be attempted on known good computers.
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