Solved

powershell compare global address list

Posted on 2016-07-28
3
62 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
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 …
This video discusses moving either the default database or any database to a new volume.

680 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