Returns basic account information for the MyerKen Active Directory user account.
On Error Resume NextSet objUser = GetObject _("LDAP://cn=Myerken,ou=Management,dc=NA,dc=fabrikam,dc=com")strUserPrincipalName = objUser.Get("userPrincipalName")strSAMAccountName = objUser.Get("sAMAccountName")strUserWorkstations = objUser.Get("userWorkstations")Set objDomain = GetObject("LDAP://dc=NA,dc=fabrikam,dc=com")strDC = objDomain.Get("dc")WScript.echo "User Principal Name: " & strUserPrincipalNameWScript.echo "SAM Account Name: " & strSAMAccountNameWScript.echo "User Workstations: " & strUserWorkstationsWScript.echo "dc: " & strDC
This is a VB Script, this can be used by saving the file in .vbs file