473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DirectorySearcher question...


I am trying to search a user object that is located in a domain that is
sub-ordinate to the one from where I begin my search. For eg. I have the
domains as DC=corp,DC=company,DC=com and DC=dept1,DC=corp,DC=company,DC=com

I use the following code:
DirectoryEntry rootDNC = new
DirectoryEntry("LDAP://DC=corp,DC=company,DC=com" );

DirectorySearcher searcher = new DirectorySearcher(rootDNC);
searcher.Filter = "(&(objectCategory=Person)(sAMAccountName=testuser ))";
searcher.SearchScope = SearchScope.Subtree;
searcher.ReferralChasing = ReferralChasingOption.Subordinate;

SearchResultCollection rC = searcher.FindAll();

The "testuser" is a user object in the child domain. Now after the FindAll
call if I attempt to examine the rC (result collection) it throws an
exception saying "a referral was returned from server".

How do I access the referral and use it to continue my search as I dont see
any method/property in result collection to do that.

I dont specify/set ReferralChasing property on the searcher I get 0 results.

Any help/pointers would be appreciated.

TIA, Jay
Jul 21 '05 #1
0 1629

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Zeno Lee | last post by:
I'm trying to authenticate a user against a windows network. I want it to work across any kind of windows network from NT 4.0 up to Windows 2003 ADS. So far I've been using DirectoryEntry and...
1
by: Sezgin Rafed | last post by:
Hi everyone, I need to select Users from 2 Domains - one the User has logged into and a second one, which is a trusted Domain. There is no problem selecting Users from the Domain the User has...
5
by: Dave | last post by:
Hi All C# ADSI samples that I run cause unspecified errors. If I translate them into VB.NET they run fine. Here's an example: public string getEmail(string LDAPPath, string username) {...
4
by: cameron | last post by:
I have always been under the impression that LDAP was optimized for speed. Fast queries, fast access, slower writes. I have a block of data in LDAP and in SQL. Exact same data. The query is fast...
1
by: Jay | last post by:
I need to add a parameter to a directorysearcher.filter rather than using hard-coded text. I have the following code that finds all members of an AD group and then for each of those results tries...
0
by: Shaun via .NET 247 | last post by:
Hi there, I have a problem with System.DirectoryServices.DirectorySearcher . I have a VB.Net Web Application containing a web form which has on it a text box, a list box and a button. The form...
0
by: Jayant Sane | last post by:
I am trying to search a user object that is located in a domain that is sub-ordinate to the one from where I begin my search. For eg. I have the domains as DC=corp,DC=company,DC=com and...
2
by: Jim in Arizona | last post by:
I'm trying to do a check to see if a specific active directory user account exists in active directory AND a specific group. I can't seem to get the filter down right. I can do this to find a...
6
by: Zetten | last post by:
I have an AD search module which works as I want it to; searching for a matching forename and/or surname in the appropriate OU. I would like to extend it to be more flexible, so that instead of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.