Query by OU but not include sub OU
Can't seem to figure out the right search terms for this so I'm asking. How do you create a query to search by OU but not include sub OU's
For example we have:
Domain: ABC.LOCAL
OU1
OU2 OU3
select * from SMS_R_System where SMS_R_System.SystemOUName = "ABC.LOCAL/OU1"
When I use the query above I'm getting results for every system in OU1, OU2 and OU3, is there an easy way to just get systems in OU1? Should I be looking at subselect queries?
July 20th, 2010 6:34pm
Check out this thread: http://social.technet.microsoft.com/Forums/en-US/configmgrgeneral/thread/38bc6ed3-6566-4ff6-a979-e84c6095d2c9Scott Gill
SCCM Consultant
Free Windows Admin Tool Kit Click here and download it now
July 20th, 2010 9:20pm
Thank you I figured I'd have to do subslected query, was hoping for an easier way. I have about about 100 sub OU's that need to be addressed individually due to GPO's.
July 20th, 2010 9:43pm