SharePoint treat the domain group as a user. A new entry will be created in the userinfo list(hidden list) as soons as a new domain group added in sharepoint site collection or in the sub site directly. This entry will be created only one time for site collection. The userinfo list view accessable by passing _catelogs/users/simple.aspx in the URL (http://sitecollection:8080/_catelogs/user.simple.aspx).
In SharePoint SPGroup or Domain group can become a owner of another group in SharePoint(SPGroup and Domain Group). To find out the Onwed groups of a SPgroup or Domain Group use below source.
static void Main(string[] args)
{
try
{
using (SPSite siteColl = new SPSite("http://sitecollection/"))
{
//For nested SharePoint groups
SPGroupCollection groups = siteColl.RootWeb.Groups;
foreach (SPGroup group in groups)
{
if(group.Owner.ToString()=="GroupA" )
{
Console.WriteLine("\nGroup Name: " + group.Name + " Group Type: " + group.LoginName);
}
}
//For nested domain groups
SPUser usr=siteColl.RootWeb.AllUsers["domain\groupName"];
foreach (SPGroup domainGroup in usr.OwnedGroups)
{
Console.WriteLine("\nGroup Name: " + domainGroup.Name + " Group Type: " + domainGroup.LoginName);
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error :"+ex.Message);
}
Console.WriteLine("Done");
Console.ReadLine();
}
I have been searching for a useful post like this on salesforce course details, it is highly helpful for me and I have a great experience with this Salesforce Training who are providing certification and job assistance. Salesforce admin training in Gurgaon
ReplyDelete