I have an OU called Production which has many child OU’s. (Ex 1) When Scoping a query to the Production OU, only one server shows up which lives in the root of production. (Ex 2) When attempting an AND statement with the next OU, SCOM outputs no members at all. How can I get all computers living under an OU to be dynamic members of a group?
Ex 1: ( Object is Windows Computer AND ( Organizational Unit Equals OU=Production Servers,OU=COMPANY Servers,DC=COMPANY,DC=local ) AND True )
Ex 2: ( Object is Windows Computer AND ( Organizational Unit Equals OU=Production Servers,OU=COMPANY Servers,DC=COMPANY,DC=local ) AND ( Organizational Unit Equals OU=COMPANY Link,OU=Production Servers,OU=COMPANY Servers,DC=COMPANY,DC=local ) )
Easy fix. Still would like to be able to dynamically populate any Server additions under new OU’s added without having to add the OU to the Group Query? Is this possible?
Sounds like you’d need to use a regex here (Matches regular expression) to correctly capture the OU and any child OUs. Something like this should do the trick:
This will match the provided OU and recursively any child OUs (the first part makes child OUs optional, the $ on the end terminates the regex and prevents it matching deeply nested domains).