Last post Sep 10, 2010 06:53 AM by johram
Sep 09, 2010 10:14 AM|nikhil3102|LINK
this is what i used:
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)
Response.Write(" already exists");
It throws me out saying genral access denied............Please help me in finding the exact solution on how i could create a configuration page such that a certain set of groups could be assigned to my application.
Sep 10, 2010 06:53 AM|johram|LINK
This is a classic problem :-) You need to make sure that you run this code with a user that has sufficient priviliges to do modifications.
This can be done in several ways - either you authenticate explicitly in code (second and third parameter of the DirectoryEntry constructor), or you make sure this code is run (i.e. its app pool) under a special user. I'd suggest you start with reading the
common problems and solutions: http://forums.asp.net/t/897609.aspx Good luck!