Retrieves user account attributes found on the General Properties page of the user account object in Active Directory users and Computers.
On Error Resume NextSet objUser = GetObject _("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")objUser.GetInfostrGivenName = objUser.Get("givenName")strInitials = objUser.Get("initials")strSn = objUser.Get("sn")strDisplayName = objUser.Get("displayName")strPhysicalDeliveryOfficeName = _objUser.Get("physicalDeliveryOfficeName")strTelephoneNumber = objUser.Get("telephoneNumber")strMail = objUser.Get("mail")strWwwHomePage = objUser.Get("wWWHomePage")strDescription = objUser.GetEx("description")strOtherTelephone = objUser.GetEx("otherTelephone")strUrl = objUser.GetEx("url")WScript.echo "givenName: " & strGivenNameWScript.echo "initials: " & strInitialsWScript.echo "sn: " & strSnWScript.echo "displayName: " & strDisplayNameWScript.echo "physicalDeliveryOfficeName: " & _strPhysicalDeliveryOfficeNameWScript.echo "telephoneNumber: " & strTelephoneNumberWScript.echo "mail: " & strMailWScript.echo "wWWHomePage: " & strWwwHomePageFor Each strValue in strDescriptionWScript.echo "description: " & strValueNextFor Each strValue in strOtherTelephoneWScript.echo "otherTelephone: " & strValueNextFor Each strValue in strUrlWScript.echo "url: " & strValueNext
This is a VB Script, this can be used by saving the file in .vbs file