Solved

powershell compare global address list

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
To show how to generate a certificate request 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 Servers >> Certificates…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 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