Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

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.
0
Jorge Ocampo
Asked:
Jorge Ocampo
  • 2
1 Solution
 
Chamara WeliwattageCommented:
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now