Summary: This article contains step-by-step instructions on how to get AD Users report where user phone numbers are split into area code and the number itself. The area code and the phone number will be displayed in different columns and will have only digits.
Applies to: Cayosoft Administrator 7.x or later.
ID: KB20210423-1
Configuration
- In Admin Console create AD Users rule.
- Set Limit Scope and Query criteria.
- Copy\paste the script below to Properties to display. This script will add AreaCode and PhoneNumber columns to the report and remove dashes, spaces, brackets, single quotas and dots from the number:
SamAccountName~User Logon Name,UserPrincipalName~User Principal Name,telephoneNumber~AreaCode~`$phone=`$_.'telephoneNumber';`$phone=`$phone.Replace('-'_comma_'').Replace(' '_comma_'').Replace('('_comma_'').Replace(')'_comma_'').Replace('.'_comma_'');PSFirst `$phone 3,telephoneNumber~PhoneNumber~`$phone=`$_.'telephoneNumber';`$phone=`$phone.Replace('-'_comma_'').Replace(' '_comma_'').Replace('('_comma_'').Replace(')'_comma_'').Replace('.'_comma_'');PSLast `$phone 7
- Save changes.
Result
User phone numbers before the script is applied:
User phone numbers after the script is applied:
Comments
0 comments
Please sign in to leave a comment.