Chris Noga

Chris Noga

  • NA
  • 1
  • 6.1k

VB.net Active Directory: how to read list of PC's from OU within an OU

Jan 6 2011 12:05 PM
Hi Everyone,

I'm working on a program that needs to read a list of PC's from Active Directory a few levels down in the OU structure.

The AD path I would need to access is this:

company.com - Divison1 - Site1 - Computers

Division 1, Site1 and Computers are all OUs.

Problem is any tutorials I have found online show how to read only ALL PC's from Active Directory. That would amount to over 22,000 PCs in my company.

I need to read all PC's from the 'Computers' OU in the above path or at least all computers in the 'Site1' OU using VB.net


Could someone point me in the right direction here or provide code samples for accomplishing this?

Many Thanks.