Solved

How to run a directorysearcher from one domain to another.

Posted on 2012-04-05
2
254 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
Comment Utility
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
Comment Utility
Thanks . that helped.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

11 Experts available now in Live!

Get 1:1 Help Now