Solved

powershell compare global address list

Posted on 2016-07-28
3
60 Views
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.
0
Comment
Question by:Jorge Ocampo
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
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 = $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
 
LVL 2

Author Comment

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

Author Comment

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

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
In this video we show how to create a Distribution Group 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 >>…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …

828 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