Author: JTP1987 | Posted on: 9/14/2009 1:12:22 PM | Views : 638

 Hey
I am trying to create an security group in my active directory, and have found this pease of code:
public void Create(string ouPath, string name) { if (!DirectoryEntry.Exists("LDAP://CN=" + name + "," + ouPath)) { try { DirectoryEntry entry = new DirectoryEntry("LDAP://" + ouPath); DirectoryEntry group = entry.Children.Add("CN=" + name, "group"); group.Properties["sAmAccountName"].Value = name; group.CommitChanges(); } catch (Exception e) { Console.WriteLine(e.Message.ToString()); } } else { Console.WriteLine(path + " already exists"); } }
 
But how du i configurate it? And how do i call it?
...

Go to the complete details ...