Skip to content

Instantly share code, notes, and snippets.

@Spartan-196
Last active February 23, 2018 04:29
Show Gist options
  • Save Spartan-196/1dd6321f281f18a6714065554cc1293c to your computer and use it in GitHub Desktop.
Save Spartan-196/1dd6321f281f18a6714065554cc1293c to your computer and use it in GitHub Desktop.
SCCM Collection Members from AD Groups

Replace [Domain] and [groupname] with the the apropriate values for your domain and the group you want to pull members from.

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.SystemGroupName = "[Domain]\\[groupname]"

Worth noting that this is a single line so if you copy pasteing may be easier to use the code block

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.SystemGroupName = "[Domain]\\[groupname]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment