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.

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: Logo

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

Facebook photo

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

Connecting to %s