List a users First and Last name when called with a Distinguished Name.


' Display First and Last name for a given DN

On Error Resume Next
Dim  objUser, strDN

strDN = WScript.Arguments.Item(0)
Set objUser = GetObject("LDAP://" & strDN)
WScript.Echo "First name: " & objUser.givenName
WScript.Echo "Last name: " &
WScript.Echo "Display name: " & objUser.displayName


cscript //Nologo uname.vbs "CN=johndoe,OU=Users,DC=ss64,DC=com"

“Always end the name of your child with a vowel, so that when you yell the name will carry” ~ Bill Cosby


UserInfo - List User properties (as shown in ADUC)

Copyright © 1999-2017
Some rights reserved