Solved

How can I display Distribution Group membership lists in Sharepoint?

Posted on 2012-03-27
3
637 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A question that is asked often, is how to generate sequential numbers in InfoPath Forms. The best way to achieve this is to use a SQL database, along with a stored procedure and a web service to connect Forms Services to the DB. The first thing t…
When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 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

17 Experts available now in Live!

Get 1:1 Help Now