Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

get users from SP Domain Group

  Asked By: Colt    Date: Aug 02    Category: Sharepoint    Views: 3035

I have successfully pulled the users information into a Web part;
their email, user name, etc ... but when the 'user' is an active
directory security group, it shows the name of the group only and
not the individual members of that group. My code looks like this:

SPSite siteCollection = SPControl.GetContextSite(Context);
SPWeb site = siteCollection.AllWebs[""];
SPUserCollection users = site.Users;

foreach (SPUser user in users)
if (user.IsDomainGroup == true)
(output.Write( user.Name + " is a SharePoint Group <br />");
output.Write("User: " + (user.Name)
+ "      ");
output.Write("<a href='http://servername/MySite/Public.aspx?
accountname=" + user.LoginName + " '>Personal Site </a> <br />");
output.Write("E-Mail: " + (user.Email ) + "<p />");
catch(Exception excpt)

anyone have a code snippett to extract the individual users from the
domain group?



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on get users from SP Domain Group Or get search suggestion and latest updates.