Friday, May 27, 2011

SCCM Queries for AD objects

Here are some queries for filtering on AD objects like Ad Site or AD OU:

1. Query for a single organizational unit:

select * from SMS_R_System where SystemOUName = "ABC1.ABC.YOURDOMAIN.COM/ OUNAME / OUNAME / OUNAME /WORKSTATIONS/STANDARD"

2. Query for multiple organizational units:

select * from SMS_R_System where SystemOUName in ( "ABC1.ABC. YOURDOMAIN.COM/OUNAME/OUNAME/OUNAME/OUNAME/WORKSTATIONS", "XX.XX. YOURDOMAIN.COM/NAME/OUNAME/OUNAME/WORKSTATIONS" )

3. Query for a single Active Directory Site:

select * from SMS_R_System where ADSiteName = "Default-First-Site-Name"

4. Query for a multiple Active Directory Sites:

select * from SMS_R_System where ADSiteName in ( "Default-First-Site-Name", "Site-XXX" )

No comments:

Post a Comment