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
Printable View
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
I just modified this code base on the MSDN sample code.
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