Click here to Skip to main content
15,937,429 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to create group in server using idap connection. please tel me the solution

1 solution

Don't repost. Try something from answers to your previous question[^].
I already suggested to use
public void Create(string ouPath, string name)
    if (!DirectoryEntry.Exists("LDAP://CN=" + name + "," + ouPath))
            DirectoryEntry entry = new DirectoryEntry("LDAP://" + ouPath);
            DirectoryEntry group = entry.Children.Add("CN=" + name, "group");
            group.Properties["sAmAccountName"].Value = name;
        catch (Exception e)
    else { Console.WriteLine(path + " already exists"); }
Share this answer
Nickos_me 14-Nov-11 6:57am    
I think, it's not good that you don't use using across of DirectoryEntry:
Or I did't right?
Prerak Patel 14-Nov-11 7:09am    
This code is from the linked article in OP's previous question. I was pointing him to that, so that he stops reposting the same question.
Nickos_me 14-Nov-11 9:00am    
Yes, sorry, I understand.
But I just ask you for your opinion :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900