views:

169

answers:

1

Hi everyone! 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 do that in C#? Thanks in advance.

A: 

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.

Joe