Returns address-related attribute values for the MyerKen Active Directory user account.
On Error Resume NextSet objUser = GetObject _("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")strStreetAddress = objUser.Get("streetAddress")strLocalityName = objUser.Get("l")strStreetName = objUser.Get("st")strPostalCode = objUser.Get("postalCode")strCountryName = objUser.Get("c")arrPostOfficeBox = objUser.GetEx("postOfficeBox")WScript.echo "Street Address: " & strStreetAddressWScript.echo "Locality: " & strLocalityNameWScript.echo "Street: " & strStreetNameWScript.echo "Postal Code: " & strPostalCodeWScript.echo "Country: " & strCountryNameWScript.echo "Post Office Boxes:"For Each strValue in arrPostOfficeBoxWScript.echo vbTab & vbTab & strValueNext
This is a VB Script, this can be used by saving the file in .vbs file