Wednesday, September 10, 2008

Getting all the group for a particular web


public IList<string> GetAllUserGroups(string url)
{
IList<string> groupList = new List<string>();

using (SPSite site = new SPSite(url))
{
SPGroupCollection groups = site.RootWeb.SiteGroups;

foreach (SPGroup g in groups)
{
groupList.Add(g.Name);
}
}

return groupList;
}

0 comments: