Solved

How can I display Distribution Group membership lists in Sharepoint?

Posted on 2012-03-27
3
680 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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