Retrieves user account attributes found on the Telephones 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.GetInfostrHomePhone = objUser.Get("homePhone")strPager = objUser.Get("pager")strMobile = objUser.Get("mobile")strIpPhone = objUser.Get("ipPhone")strInfo = objUser.Get("info")strFacsimileTelephoneNumber = _objUser.Get("facsimileTelephoneNumber")strOtherHomePhone = objUser.GetEx("otherHomePhone")strOtherPager = objUser.GetEx("otherPager")strOtherMobile = objUser.GetEx("otherMobile")strOtherIpPhone = objUser.GetEx("otherIpPhone")strOtherFacsimileTelephoneNumber = _objUser.GetEx("otherFacsimileTelephoneNumber")WScript.echo "homePhone: " & strHomePhoneWScript.echo "pager: " & strPagerWScript.echo "mobile: " & strMobileWScript.echo "ipPhone: " & strIpPhoneWScript.echo "info: " & strInfoWScript.echo "facsimileTelephoneNumber: " & _strFacsimileTelephoneNumberFor Each strValue in strOtherHomePhoneWScript.echo "otherHomePhone: " & strValueNextFor Each strValue in strOtherPagerWScript.echo "otherPager: " & strValueNextFor Each strValue in strOtherMobileWScript.echo "otherMobile: " & strValueNextFor Each strValue in strOtherIpPhoneWScript.echo "otherIpPhone: " & strValueNextFor Each strValue in strOtherFacsimileTelephoneNumberWScript.echo "otherFacsimileTelephoneNumber: " & strValueNext
This is a VB Script, this can be used by saving the file in .vbs file