Created
November 19, 2013 17:31
-
-
Save milsosa/7549125 to your computer and use it in GitHub Desktop.
List all users of an specific domain Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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