by Anonymous (267 Submissions)
Category: Windows System Services
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 4th May 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
ADSI sample - Retrieves all users and some of their properties in a Windows 2000 AD domain or Windows NT4 domain. If domain is a computer, all
' List all users and some of their properties in a Windows 2000 AD domain or
' Windows NT4 domain. If domain is a computer, all users of the local SAM
' database are displayed.
' Goto http://www.activexperts.com/activmonitor and click on ADSI Samples
' for more samples
Sub ListUsers( strDomain )
Set objComputer = GetObject("WinNT://" & strDomain )
objComputer.Filter = Array( "User" )
For Each objUser In objComputer
WScript.Echo "Name: " & objUser.Name
WScript.Echo "Fullname: " & objUser.Fullname
WScript.Echo "Description: " & objUser.Description
WScript.Echo "AccountDisabled: " & objUser.AccountDisabled
WScript.Echo "IsAccountLocked: " & objUser.IsAccountLocked
WScript.Echo "Profile: " & objUser.Profile
WScript.Echo "LoginScript: " & objUser.LoginScript
WScript.Echo "HomeDirectory: " & objUser.HomeDirectory
WScript.Echo ""
Next
End Sub
' Main
Dim strDomain
Do
strDomain = inputbox( "Please enter a domainname", "Input" )
Loop until strDomain <> ""
ListUsers( strDomain )
WScript.Echo( vbCrlf & "For more samples, goto http://www.activexperts.com/activmonitor and click" )
WScript.Echo( "on ADSI samples" )
No comments have been posted about ADSI sample - Retrieves all users and some of their properties in a Windows 2000 AD domain or Windo. Why not be the first to post a comment about ADSI sample - Retrieves all users and some of their properties in a Windows 2000 AD domain or Windo.