Solved

How to run a directorysearcher from one domain to another.

Posted on 2012-04-05
2
256 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 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