Solved

How to run a directorysearcher from one domain to another.

Posted on 2012-04-05
2
255 Views
Last Modified: 2012-04-12
Hello,
I have an asp.net application developed which has a class that has directoryservices referenced in it. The purpose is to use the directory searcher(LDAP) to locate the details from an active directory. In this case lets say we have two domains. First domain called DomainA, and second one called DomainB.

Now I have my web server hosted on DomainB. However the active directory in that domain does not have many of the user details that I want, and so my asp.net application will have to look into DomainA active directory from the iis installed on DomainB.

What is the best way to do this.
0
Comment
Question by:DoubtMan
2 Comments
 
LVL 16

Accepted Solution

by:
Vikram Singh Saini earned 500 total points
ID: 37813178
I can't say about best method. But for problem I would have passed modified path for domain A as:

string adminPath = @"LDAP://DomainControllerB.Domain.Parts/OU=USERS,OU=RJSO,OU=MARKETING,DC=Domain,DC=Parts"/";

 DirectoryEntry AD= new DirectoryEntry(adminPath, adUser, adPass, AuthenticationTypes.Secure);

public static void ShowDetails(string adminPath)
    {
using (DirectorySearcher ds = new DirectorySearcher(AD))
                {
                    // Code implementation here
                }
}

// Code here for rechecking by passing adminPath and other fields for domain A to above function.

Open in new window

0
 

Author Closing Comment

by:DoubtMan
ID: 37837794
Thanks . that helped.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now