Creating a User Collection based on users not in a AD User Group


Based on the following I thought it would be worth posting the query required to create a collection based on users that are not a member of a particular AD user group. This may come in handy when unpublishing App-V packages for certain users.


Select
SMS_R_USER.ResourceID,SMS_R_USER.ResourceType,SMS_R_USER.Name,SMS_R_USER.UniqueUserName,SMS_R_USER.WindowsNTDomain
from SMS_R_User
where SMS_R_User.ResourceID not in (select SMS_R_USER.ResourceID
from SMS_R_User
where SMS_R_User.UserGroupName like "DOMAIN\\Group")

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s