powershell compare global address list

Posted on 2016-07-28
Last Modified: 2016-08-18
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.
Question by:Jorge Ocampo
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

Chamara Weliwattage earned 500 total points
ID: 41734499
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 = $

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

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


Author Comment

by:Jorge Ocampo
ID: 41734658
i actually have email address instead of alias

Author Comment

by:Jorge Ocampo
ID: 41739789
could i use the smtp address instead of the alias?

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question