Find the account of the pager number in the CSV form in batch and export his pager and UserPrincipalName
# Author:Young, when: January 2018
# Email:azhe.911@foxmail.combr/ > # Author:Young, when: January 2018
# Email:azhe.911@foxmail.com
# Version:1.2
#
Import-Module ActiveDirectory
Import-Module-Name ActiveDirectory
Add-PSSnapin Microsoft.Exchange*
$ADUser=gc C:\ Users\ yuanzhe\ Desktop\ pager.csv
Foreach ($Users in $ADUser)
{
# plug select the account pager and UserPrincipalName attributes corresponding to the pager number in my table, and import the results into pagers.csv
Get-ADUser-Filter {pager-eq $Users}-Properties pager,UserPrincipalName | select pager,UserPrincipalName | Export-Csv-Append-NoTypeInformation-Encoding UTF8-Path pagers.csv
}