Retrieves user account attributes found on the Address 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.GetInfostrStreetAddress = objUser.Get("streetAddress")strPostOfficeBox = objUser.Get("postOfficeBox")strLocalityName = objUser.Get("l")strStreetName = objUser.Get("st")strPostalCode = objUser.Get("postalCode")strCountryName = objUser.Get("c")WScript.Echo "streetAddress: " & strStreetAddressWScript.Echo "postOfficeBox: " & strPostOfficeBoxWScript.Echo "l: " & strLocalityNameWScript.Echo "st: " & strStreetNameWScript.Echo "postalCode: " & strPostalCodeWScript.Echo "c: " & strCountryName
This is a VB Script, this can be used by saving the file in .vbs file