PDA

Click to See Complete Forum and Search --> : NT Users!


Jun 6th, 2000, 05:49 PM
Hi,

How can I get the list of users registered on NT on a specific domain? I want to get that list to include the login id and login name details.

Any help in this regard is appreciated.

Regards,
Subrahmanyam

Chris
Jun 7th, 2000, 10:09 AM
I just modified this code base on the MSDN sample code.

Dim TheDomain As IADsDomain
Dim User As IADsUser
Dim strDomain As String

'Accept the Domain name
strDomain = InputBox("Domain Name: ")

'Use the WinNT Directory Services
strDomain = "WinNT://" & strDomain

'Create the Domain object
Set TheDomain = GetObject(strDomain)

'Search for Computers in the Domain
TheDomain.Filter = Array("User")

On Error Resume Next
For Each User In TheDomain
DoEvents
Debug.Print User.Name
Next User

'Clean up
Set User = Nothing
Set TheDomain = Nothing