Bulk Enable Unified Messaging Mailboxes

As I am getting my hands on Unified Messaging, I have started loving the feature & want to quickly deploy it for the users but we have a bit different setup, so script needs tweaking..

We already have a Lync that uses SIP & now we are integrating Avaya with UM (not Lync) that also uses SIP

Thats why While enabling users for UM ,Exchange throws below error:

To fix it, we just enable the user by selecting Automatically-generated SIP resource identifier:


After account is enabled we go inside the Email Tab & Edit the EUM section, replace the email address inside it with

+number@domain.com (SIP generated by Avaya)

So In the script We have to cover this error as well :), logic has been placed to modify EUM.

Download it from below link :

https://gallery.technet.microsoft.com/scriptcenter/Bulk-Enable-Unified-7ef82387

update the UMenable.csv file with users (id,extension) & change the variables:

$extn = “123” + $extension

$asip = “+123” + $extension + “@” + “domain.com”

$pin = “123456”

$umpol = “Global Dial Plan Default Policy”

$eum = “EUM:$asip;phone-context=Global Dial Plan.domain.com”

Now run the script & it will enable all users in the csv , will show on screen success/failures as well as logs it inside the logs folder.

You can modify the script as per your requirements, as there can be  differences in the setup.

########################################################### 
#        Author: Vikas Sukhija (http://msexchange.me)     
#        Date: 3/30/2016 
#        Reviewer: 
#        Desc: Bulk Enable UM Mailboxes 
########################################################### 
 
#--------For Log Files-------------- 
 
$date = get-date -format d  
$date = $date.ToString().Replace(“/”, “-”)  
$time = get-date -format t  
$time = $time.ToString().Replace(":""-")  
$time = $time.ToString().Replace(" """)  
 
$logs = ".\Logs" + "\" + "UMEnable" + $date + "_" + $time + "_.log" 
 
###################import modules########################### 
 
If ((Get-PSSnapin | where {$_.Name -match "Microsoft.Exchange.Management.PowerShell.E2010"}) -eq $null) 
{ 
    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 
} 
 
Start-Transcript -Path $logs 
$error.clear() 
 
###########import CSV############################## 
 
$data = import-csv .\UMenable.csv 
 
foreach($i in $data) { 
 
$networkid = $i.Networkid 
$extension = $i.Extension 
 
$extn = "123" + $extension 
$asip = "+123" + $extension + "@" + "domain.com" 
$pin = "123456" 
$umpol = "Global Dial Plan Default Policy" 
$eum = "EUM:$asip;phone-context=Global Dial Plan.domain.com" 
 
$chkmbx = get-mailbox $networkid  -ea silentlycontinue 
 
if($chkmbx){ 
 
$alias = $chkmbx.Alias 
 
Enable-ummailbox -id $alias -Pin $pin -PinExpired $True -ummailboxpolicy $umpol -extensions $extn 
 
For($i = 1; $i -le "5"$i++){ sleep 1;Write-Progress -Activity "Enaling UM for $alias with ext $extn" -status "$i" -percentComplete ($i /10*100)} 
 
$chgeum = get-mailbox $alias 
$chgeum.EmailAddresses.Item(1) = $eum 
set-mailbox $alias -emailaddresses $chgeum.EmailAddresses 
 
if($error){ 
Write-host "Error on Enabling User $networkid for Unified messaging with $extn" -foregroundcolor yellow 
$error.clear()} 
else{ 
Write-host "Enabled User $networkid for Unified messaging with $extn" -foregroundcolor green} 
} 
 
else 
{  
Write-host "User $networkid doen'nt have a mailbox" -foregroundcolor Red 
 
} 
 
} 
stop-transcript 
######################################################    
Regards
Sukhija Vikas
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s