Get the Names of All Users in the Domain Using ADSI/LDAP

Category:
Windows 2000/XP
Type:
Snippets
Difficulty:
Intermediate
Author:
Intelligent Solutions Inc.

Version Compatibility: Visual Basic 6

More information:
This example uses the LDAP provider to retrieve the names of all users in the domain the machine is logged on to. It was tested on Windows 2000 RC2, and requires that ADSI is installed and that the currently logged on user has administrative privileges.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: