Skip to content

Instantly share code, notes, and snippets.

@milsosa
Created November 19, 2013 17:31
Show Gist options
  • Save milsosa/7549125 to your computer and use it in GitHub Desktop.
Save milsosa/7549125 to your computer and use it in GitHub Desktop.
List all users of an specific domain Windows
'ListUsers.vbs
On Error Resume Next
Set objDomain = GetObject("WinNT://YourDomain")
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment