Copying AD Users into a SharePoint 2010 SPGroup
I've run into a problem with SharePoint 2010 configured for Claims auth where the claims provider wont recursively read group membership. So if you have a claims group configured with a child group that contains users, like this:
- my_master_group
- User1
- my_child_group
- User2
And then try to assign my_master_group rights to a SharePoint site, only User1 picks up those rights. User2 is ignored. So only top level group members are ever granted rights. In my case, my source claims repository has complex nested group structure that is synced up with our orgs Active Directory. I have one master group that recursively holds all my group members and now I just want to get them into a SPGroup that I can then use for granting rights to my site. Here is my first stab at a rough solution for this, until the provider issue is resolved.
Create a scheduled task to copy AD members into a SPGroup
The plan is to first query AD, get a recursive list of my_master_group members and add them to the SharePoint group sp_my_master_group.