Last post Jul 17, 2008 03:37 AM by palavesh
Jul 17, 2007 06:03 AMemail@example.com|LINK
I am creating active directory user in c#.I am selecting a template(i.e. all the active directory users present on the system)
before creating the user in active directory.(I mean to say that when i have selected 'administrator' in the template then all then the newly created user will get
all the credentials or roles that administrator is having.)
Please help me how can i achieve this?
Thanks in advance.
Jul 17, 2008 03:37 AM|palavesh|LINK
When i try to List the users from Active directory, i get this exception.
Error while processing.System.Runtime.InteropServices.COMException (0x80072020): An operations error occurred at System.DirectoryServices.DirectoryEntry.Bind(Boolean
throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_AdsObject() at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) at System.DirectoryServices.DirectorySearcher.FindAll()
The code i used is :
deSearch.Filter = "(&(objectClass=user) (cn=" + UserName +"))";
SearchResultCollection results = deSearch.FindAll();
But the DirectoyEntry method is getting validated if i use the overloaded method :
DirectoryEntry(_path, domainAndUsername, password);
Please advice me.
active Directory C# user groups