Bulk enable Office 365 UM Mailboxes

This evening I came across an engineer who was trying to enable about 500 users for voicemail in the Office 365 portal by tediously clicking on each individual user, typing in their extension number, selecting a voicemail policy, etc. It would have taken him hours.

My first script was quick and dirty and got the job done with the help of some column editing and macros in Notepad++

Version 2 is a bit more refined. Export all your users from Lync or SfB like this:

get-csuser | ft sipaddress,lineuri > users.csv

Edit the csv with notepad++ to:

  • add a new line at the top with the content “upn,ext” to act as headers
  • remove the existing column headers
  • remove the sip: at the start of each upn
  • remove everything except the user’s extension
  • put a comma between the upns and extensions

Once you’re done, save it out and run this guy:

$mailboxes =  Import-CSV “users.csv”
FOREACH ($mailbox in $mailboxes) {
Enable-UMMailbox -Identity $Mailbox.upn -ummailboxpolicy “Office365UM Default Policy” -pin 131313 -pinexpired $true -Extensions $Mailbox.ext -NotifyEmail $Mailbox.upn
}

This will enable every user for voicemail and then send them an email to let them know their new PIN. Not super elegant, but it gets the job done.

 

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