A
Amadelle
Hi all,
I am so desparately in need of some guidance! After two days of struggling I still can't connect to the Active Directory server. I have used so many different ways and so many different string paths and I still don't have a successful connection.
Things I have tried:
Using Directory Searcher:
DirectorySearcher ds = new DirectorySearcher();
ds.SearchRoot = new DirectoryEntry();
SearchResult rs = ds.FindOne(); //This fails
Using just DirectoryEntry:
DirectoryEntry ent = new DirectoryEntry("LDAP://myDC/CN=Users,DC=corp,DC=domainName,DC=com");
or
DirectoryEntry ent = new DirectoryEntry("LDAP://myDC.corp.domainName.com/CN=Users, DC=myDC,DC=corp, DC=domainName,
DC=com");
and many other variations of the path and I still can't connect to Active Directory and it fails. Our DC is a Windows 2003 server. I am using a Windows 2000 with VS2003 .NET and C# and I am trying to write a ASP.NET page using DirectoryServices. The Path to our LDAP is myDC.corp.domainName.com. The initial DirectoryEntry ent seems to get initialized just fine. But when I open the ent or the ds in the debugger screen .. parts of it like the children properties shows a weird message saying that there was an error with the COM object (e.g. ContainerObject <error: an exception of type: {System.Runtime.InteropServices.COMException} occurred> System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsContainer). On another newsgroup someone had suggested to reference ActiveDs COM object which I did but that hasn't helped either.
At this stage I am absolutely lost and I would appreciate any type of help. I was wondering whether I would need to log on? Whether I need to use another protocol?
What am I missing,
I appreciate any insight... or any suggestions, etc.
Thanks a million,
Amadelle
I am so desparately in need of some guidance! After two days of struggling I still can't connect to the Active Directory server. I have used so many different ways and so many different string paths and I still don't have a successful connection.
Things I have tried:
Using Directory Searcher:
DirectorySearcher ds = new DirectorySearcher();
ds.SearchRoot = new DirectoryEntry();
SearchResult rs = ds.FindOne(); //This fails
Using just DirectoryEntry:
DirectoryEntry ent = new DirectoryEntry("LDAP://myDC/CN=Users,DC=corp,DC=domainName,DC=com");
or
DirectoryEntry ent = new DirectoryEntry("LDAP://myDC.corp.domainName.com/CN=Users, DC=myDC,DC=corp, DC=domainName,
DC=com");
and many other variations of the path and I still can't connect to Active Directory and it fails. Our DC is a Windows 2003 server. I am using a Windows 2000 with VS2003 .NET and C# and I am trying to write a ASP.NET page using DirectoryServices. The Path to our LDAP is myDC.corp.domainName.com. The initial DirectoryEntry ent seems to get initialized just fine. But when I open the ent or the ds in the debugger screen .. parts of it like the children properties shows a weird message saying that there was an error with the COM object (e.g. ContainerObject <error: an exception of type: {System.Runtime.InteropServices.COMException} occurred> System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsContainer). On another newsgroup someone had suggested to reference ActiveDs COM object which I did but that hasn't helped either.
At this stage I am absolutely lost and I would appreciate any type of help. I was wondering whether I would need to log on? Whether I need to use another protocol?
What am I missing,
I appreciate any insight... or any suggestions, etc.
Thanks a million,
Amadelle