Hi,
Just found this website after I posted the question in the DirectoryServices newsgroup and thought I might get a quicker answer here. I'm new to .NET so please excuse my lack of knowledge here but I couldn't find much with google.
As far as I understand, the way to search AD with .NET is using DirectorySearcher. In order to use this, you first have to provide a DirectoryEntry (e.g. LDAP://dc=domain,dc=com)
What I'm not clear on is what options are available to me when I want to search the global catalog. I realise I could probably use "GC://dc=domain,dc=com" but I didnt want to hard code entries.
The end goal would be to have .NET automatically connect to and search a GC in the same domain and same site as the computer running the code. So far, it looks as if System.DirectoryServices.ActiveDirectory has some useful functions to obtain this kind information but it doesn't seem compatible with DirectoryEntry.
If the above isn't possible, I'd also like to know what my options are for searching the GC with .NET?