Exporting all the users from an EV Provisioning Group

I spotted a post on Reddit sysadmin forum today where an EV administrator was explaining that the previous administrator had added over 1,000 individual users to a Provisioning Group and how could he export the list of usernames. Because I am inquisitive sort of person i decide to set myself the challenge of doing this using a T-SQL script. So after a bit of thinking about joins, here is what I came up with:

Select PolicyTargetMember.DisplayName
FROM PolicyTargetMember
JOIN PolicyTargetGroup
ON PolicyTargetMember.PolicytargetGroupEntryID = PolicyTargetGroup.PolicyTargetGroupEntryID
WHERE PolicyTargetGroup.DisplayName = ‘Department Heads’

I hope someone finds this useful.

Leave a Reply

Your email address will not be published. Required fields are marked *