List Users

List all the user accounts in a specific domain.

'ListUsers.vbs
On Error Resume Next

Set objDomain = GetObject("WinNT://SS64Domain")

WScript.echo "Domain : " + objDomain.name

For each objDomainItem in objDomain
  if objDomainItem.Class = "User" then
     WScript.echo objDomainItem.Name + " : Full Name: " + objDomainItem.FullName
  end if
Next

Example

cscript listusers.vbs

“An honest tale speeds best, being plainly told” ~ William Shakespeare, Richard III, Act IV, Scene IV

Related:

SearchAD - Search AD for Users, Computers or Workgroups
UserInfo - List properties of a User (as shown in ADUC)
Powershell : Get-adUser


© Copyright SS64.com 1999-2014
Some rights reserved