Friday, February 2, 2018

SCCM Device Collection from AD OU

This query will create an SCCM device collection from computers in an AD Organizational Unit


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.DistinguishedName like "%,OU=Computers,DC=contoso,DC=com"

Replacing the distinguished name of the OU with your own. Use ADSI Edit to help get the distinguished name.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.