Hi guys I have small problem...
I will be provided with group names...(each time = different group)
I need to add user there...
I use code to add users:
public void AddToGroup(string userDn, string groupDn)
{
try
{
DirectoryEntry dirEntry = new DirectoryEntry("LDAP://" + groupDn);
dirEntry.Properties["member"].Add(userDn);
dirEntry.CommitChanges();
dirEntry.Close();
}
catch (System.DirectoryServices.DirectoryServicesCOMException E)
{
LogBox.Text = E + "\n";
}
}
Unfortunately I dont know how to get groupDN for LDAP://
Is there any way to extract it?