views:

11773

answers:

8

Hi

I'm trying to create a SharePoint web part that will display all the users in a certain active directory or SharePoint security group.

So for example on the home page for a department called Human Resources, the web part will list all the people who belong to the AD or SharePoint group called HR.

It's been suggested to me that there is no relationship between the users table in SharePoint and the security groups, which I find hard to understand? If users belong to a group you would suspect there is a relationship.

Many Thanks for any suggestions

A: 

SharePoint has a "Site Users" web part (under the Miscellaneous group in the Web Part gallery) - this part is configurable and can display the members of any SharePoint security group in the site.

RedTech MOSS Team
A: 

Thanks for this that looks v useful.

78lro
A: 

Would there be a way to have this web part show all the users inside an Active Directory security group rather than a SharePoint security group?

Best Regards

78lro
+6  A: 

The Site Users web part will not expand AD security groups. For AD Security group enumeration, you may want to look at Bamboo's web parts (User Directory Web Part) or develop your own custom web part as described here: http://sharepointrookie.wordpress.com/2008/07/13/display-site-members-from-ad-groups/

RedTech MOSS Team
fantastic! Thanks for this.
78lro
A: 

SharePoint doesn't keep track of who is in what AD group, you'd have to ask the AD for that.

This isn't really a question that it's set up to answer well, the AD was designed to answer questions like "is Kevin a member of the cool kids group"

Kevin Davis
Fair point I guess - just that I have been asked to build a web part to display groups of people by the AD groups that they are in, in effect creating a community of users on each site/sub-site.It would be far easier if they were using the SP security groups!
78lro
Actually, SharePoint does keep track of who is in what AD group (this is part of User Profile syncing) it just doesn't expose that it keeps track of it as far as I know.
Chris Latta
Chris is right.. I'd forgotten that profile service in MOSS keeps track of this, but I'm not sure if there is an API to get the membership of a group though
Kevin Davis
+1  A: 

Yeah there are a tool called "Site Users" web part, which I think can do part of your requirement. But I am not sure it is under the Miscellaneous group in the Web Part gallery. I just stumbled on that tool when I fooling around in the web part gallery. Also as IFY here is another tool which, though, is a third party tool which Sync AD

Hope this helps

A: 

Awesome

But it has one odd behavior.

"approvers" can see all "contributors" and also see their own group that is "approvers" but "contrbutors" can only see other "contributors" and not the "approvers"

A: 

to suffice your need , you need to create a custom webpart in visual studio that will access the ldap server, to get the list of members under an active directory group. Furthermore, you can deploy this web art to your sharepoint site.

arindam