powershell compare global address list

need help getting a powershell script to check GAL and compare phone numbers to match my excel list, i only want to check right now.
LVL 2
Jorge OcampoAsked:
Who is Participating?
 
Chamara WeliwattageConnect With a Mentor Systems EngineerCommented:
What do you have in CSV file header ?

If your CSV header like "Alias","Phone", Run below script.
______________________________________________
$input = Import-Csv C:\Temp\Script\in.csv

foreach($mbx in $input){

$Phone2 = Get-Recipient -Identity $mbx.Alias
$Phone2 = $phone2.phone

if($mbx.phone -eq $phone2){
#
#for output update below command as required
Write-Host "$mbx phone number is correct" -ForegroundColor Green

}
if($mbx.phone -ne $phone2){
#
#for output update below command as required
Write-Host "$mbx phone number is not correct" -ForegroundColor red

}
}
0
 
Jorge OcampoAuthor Commented:
i actually have email address instead of alias
0
 
Jorge OcampoAuthor Commented:
could i use the smtp address instead of the alias?
0
All Courses

From novice to tech pro — start learning today.