Note: To add or read properties from an Active Directory group you need to have special username and password like an Active Directory admin.
DirectoryEntry addGroup;
DirectoryEntry addGroup;
string folderPath = "LDAP://CN=" + folderName + ",";
folderPath += "OU=SharedFolder,OU=Groups,DC=aaaaaa,DC=com";
protected Boolean chkGroupExistence(DirectoryEntry addGroup)
{
// chk if the requested AD group is available and a proper AD Group object is formed.
bool groupExists = true;
try
{
if (addGroup.SchemaClassName == "group")
{ groupExists = true; }
}
catch (Exception)
{
groupExists = false;
}
return groupExists;
}
Leave your comments below.
Leave your comments below.
No comments:
Post a Comment