Batch enable Office365 Voicemail for Lync 2013 On Premise

A few weeks ago a colleague pointed me to a comprehensive online instruction on how to configure and enable Hosted Unified Messaging on Office 365 for an on premise Lync deployment. It’s over here. When I reached step 6 and 7, there was a little surprise. In my case I needed to grant specific users the new HostedVoiceMailPolicy  on our on premise Lync Server (Step 6) and enable them for Unified Messaging in the Office365 Admin center (Step 7), which is a lot of work when you need to do this for 200 accounts, both on your Lync Server and on Office365

So I’ve created a CSV-file, called Voicemail365.csv,containing something like this:

Identity;Extension
batman@it.dept;133
superman@it.dept;742

A Powershell script called EnableVoicemail365.ps1

$users = Import-Csv 'D:\Scripts\Voicemail365.csv' -Delimiter:";"
$users |  % {
Enable-UMMailbox -Identity $_.Identity -UMMailboxPolicy "ITDept Voicemail Default Policy" -Extensions $_.Extension -SIPResourceIdentifier $_.Identity
}

And a Powershell script called EnableVoicemailOnPrem.ps1

$users = Import-Csv 'D:\Scripts\Voicemail365.csv' -Delimiter:";"
$users | %{
Grant-CSHostedVoicemailPolicy -Identity $_.Identity -PolicyName ITDeptVoicemail
Set-CsUser $_.Identity -HostedVoicemail $True
}

To enable enable your users, just follow these steps:

  1. Create a selection en put them in Voicemail365.csv
  2. Connect to Exchange Online Using Remote Powershell
  3. Run EnableVoicemail365.ps1
  4. Open Lync Server Management Shell
  5. Run EnableVoicemailOnPrem.ps1

Last but not least, know what you’re doing. There’s no error handling in these scripts.. and no guarantees

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