Solved

How can I display Distribution Group membership lists in Sharepoint?

Posted on 2012-03-27
3
653 Views
Last Modified: 2012-03-28
We have several distribution groups set up, and I've been asked to add a page to our Sharepoint Site that contains lists of the distribution groups and lists all of the members.  Is there a way I can do this dynamically so that I dont have to edit the page each time a new user is added or someone's role changes?
0
Comment
Question by:cnit
  • 2
3 Comments
 
LVL 18

Expert Comment

by:ivan_vagunin
ID: 37772458
Hi!
If you are using Server Edition, you can try this:

UserProfileManager profileManager = new UserProfileManager ();
MemberGroupManager groups = manager.GetMemberGroups();
foreach (MemberGroup group in groups)
{
     foreach (string user in group)
     {
      ///display user
     }
}
0
 

Author Comment

by:cnit
ID: 37773587
I'm sorry but I'm not sure where I would put the code that you have supplied.  Is this considered a Server Side Script, and if so does this article apply?
http://office.microsoft.com/en-us/sharepoint-designer-help/add-a-server-side-script-as-a-data-source-HA010119472.aspx

Right now, we are using a List to keep our group membership info, which is basically a big text box.

We are using Sharepoint Services 3.0 on Windows 2008 Standard.

Thanks
0
 
LVL 18

Accepted Solution

by:
ivan_vagunin earned 500 total points
ID: 37775152
Hi!
This is a server side code and you can put in a custom webpart or directly in page markup (you should be familar with ASP.Net development for that). But any way this code will not work in WSS 3.0 (it is only for MOSS 2007 or SharePoint Server 2010).
If you have membership info in a custom list (not AD groups) you can try to use standard listview or dataview webpart or create a custom webpart.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I used to be SharePoint evangelist in our company, so my Outlook always full of questions about how to do this, or where I can find that. One day I found such an email with the following question: "how to attach 3-State workflow (one of the workflow…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now