Hi,
I have created a webpart to create Active Directory Account. On button click i add following code but getting error
DirectoryEntry ouEntry = new DirectoryEntry("LDAP://OU=TestOU,DC=mydomain,DC=local");
When i add following line than got
DirectoryEntry childEntry = ouEntry.Children.Add("CN=NewTestUser", "user");
error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below
i also tried following but getting error:
PrincipalContext ouContex = new PrincipalContext(ContextType.Domain,"mydomain.com","OU=TestOU,DC=TDL,DC=local");
UserPrincipal up = new UserPrincipal(ouContex);
up.SamAccountName = "NewUser";
pls guide how to fix it
thx
iffi