Programmatically getting All SharePoint groups
public void getAllGroups(string SiteUrl)
{
try
{
using (SPSite osite = new SPSite(SiteUrl))
{
SPWebCollection owebcoll = osite.AllWebs;
foreach (SPWeb oweb in owebcoll)
{
foreach (SPGroup ogrp in oweb.Groups)
{
arrGroups.Add(ogrp.Name);
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Comments
Post a Comment