473,395 Members | 2,079 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,395 software developers and data experts.

Recursively Searching AD

Hey list, I have another AD question. I can now find things in my AD with
DirectorySearcher, but now I need to recursively search. Our AD is set up
to have lots and lots of containers and I need to look in them all for a
specific CN. Here is what I have so far:

Dim DSESearcher As System.DirectoryServices.DirectorySearcher = New
System.DirectoryServices.DirectorySearcher
Dim RootDSE As String = DSESearcher.SearchRoot.Path
RootDSE = RootDSE.Insert(7, "ou=users,ou=topou,") 'NEED TO SEARCH * ou's
under ou=users
Dim myDE As DirectoryEntry = New DirectoryEntry(RootDSE)
Dim myEntries As DirectoryEntries = myDE.Children
Dim thisentry As DirectoryEntry
thisentry = myEntries.Find("cn=" & lastname)
Label1.Text = thisentry.Name

My AD looks something like this:

users
|
|--> markerting
|--> support
|--> advertising
|--> adver1
|--> adver2
|-->maintenance

If I am at ou=users and need to find someone in adver2 without knowing they
are in adver2 is what I am essentially getting at.

Thanks!
Derek
Nov 21 '05 #1
0 813

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

Similar topics

4
by: Nicolas Fleury | last post by:
Hi everyone, Is there a way to compare recursively two objects (compare their members recursively)? I'm only interested in equality or non-equality (no need for lower-than...). Thx and...
2
by: John | last post by:
Hi all. If my table looks like the following EMPLID NAME BU SAL ELIG_CONFIG1 1001 Tom 10 50000 1002 Sarah 10 49000 1003 John 20 ...
1
by: Antonio Lopez Arredondo | last post by:
hi all !!! I need to copy a folder and its subfolders to another location; which class should I use ? could only find the System.IO.Directory.MOVE but don't know how to COPY. thanks in...
1
by: romain.jouin | last post by:
Hi everyone, I just wanted to propose this piece of code which is searching recursively a value in an array... and let you indicate me if there is an error... function...
2
by: melo | last post by:
Hello, I've been struggling with a function(s) to recursively set all folders and files to NOT read-only. So, I thought I'd post this message. What I need to do is: given a starting path, I...
1
by: Lanny McDonald | last post by:
I have built a treeview that looks something like: Root .....FolderLevel1a .........FolderLevel2a
3
by: Kamen TOMOV | last post by:
Hi, Is uploading recursively directories to a web server possible with JavaScript? I mean is it possible read a directory recursively and dynamically construct <input type="file"> with value...
12
by: David Beoulve | last post by:
In my windows C# app, I create a thread to separate the main code block from the GUI, which recursively sorts through all the directories starting from a given point, and every time it finds a...
11
by: shanmugaster | last post by:
Hi, I have a string array which may contain 5 digit values or NULL or just blank spaces. I should print the value of array as an integer. that is it should print 0 when it encounters NULL and...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.