Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


powershell compare global address list

Posted on 2016-07-28
Medium Priority
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 2000 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 = $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


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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

New style of hardware planning for Microsoft Exchange server.
One-stop solution for Exchange Administrators to address all MS Exchange Server issues, which is known by the name of Stellar Exchange Toolkit.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

730 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