Looking for a Active Directory users in trusted domains in C#
I have an AD domain (let's refer to it as DMN) and credentials to access it. My aim is to retrieve information about another user. It is pretty easy when this user is registered in the domain DMN. But this user can be a part of a DMN-trusted domain. So I have to look for this user in all domains trusted to DMN. Any suggestions how to d开发者_运维百科o that in C#? Thanks in advance.
You need to find the domain naming contexts for the domains you are interested in.
The directory entry rootDSE has a property configurationNamingContext. IIRC this will find you the forest configuration container, where you will find the naming context and NetBIOS names of the other domains.
I suggest you look at this Technet article to get started, and browse the rootDSE entry of your domain to find your way around.
If you're still having problems, post again - I have some code that does this somewhere and I'll try to dig it out.
精彩评论