Exchange Unified Messaging – enable multiple mailboxes for UM

When configuring Exchange Unified Messaging, the last step in the process is to enable a mailbox for Unified Messaging. This means, each individual user from OCS need to have a mailbox, and this mailbox needs to be enabled for UM. In my situation, all OCS users already had an exchange mailbox, as only the UM role was new to them. So, the only thing to do (after installation and configuration / integration of the UM role) was to enable the mailboxes for UM.

However, I found that there is no simple way to enable multiple users for UM. While this should be possible – I only had to mention Exchange aliasses and the UM policy – the rest could be set automatically. Yes, of course, the PIN code should be set as expired, but the random PIN would do since exchange will send the affected users a mail with this random, expired PIN.

I decided to create a simple, but effective PowerShell command. It reads a file “EndUsers.CSV” but this can be configured. For each line it will trigger the powershell-command to enable the mailbox for UM, with the defined options. With a little tweaking (input file, output file, create correct formatted CSV, set applicable command-options) this script could be used by anyone, which is why I share it with you here.

################################################################################
################################################################################
#
# Microsoft Exchange Server 2007/2010 Unified Messaging Role
#
# Enables multiple mailboxes for UM using defined and default settings
#
# Written by: Louis Herber
# http://ms-uc.azurewebsites.net
#
################################################################################
################################################################################
################################################################################
# Enter the locations here
#
# File is the location of the to-be created logfile
#
# Import is the CSV with user names (users with OCS Enterprise Voice enabled)
# and corresponding Exchange aliasses Use “name” and “exchange” as headers in
# the CSV file
#
# MBXPol is the name given to the Unified Messaging Mailbox Policy created
# for these users.
################################################################################
$File = “.\Output.txt”
$Import = Import-CSV .\EndUsers.csv
$MBXPol = “Utrecht Default Policy”
################################################################################
# Configure options in the “Enable-UMMAilbox” line. Add or remove attributes
# as you wish :-)
################################################################################
foreach ($EndUser in $Import)
{
Enable-UMMailbox -Identity $EndUser.Exchange -UMMailboxPolicy $MBXPol -PINExpired $true >> $File
Write-Host $EndUser.Name -foregroundcolor cyan -nonewline
Write-Host ” has exchange-alias ” -nonewline
Write-Host $EndUser.Exchange -foregroundcolor blue -nonewline
Write-Host ” and has now been enabled for Exchange UM”
}

As you can see, the CSV should contain the “Name” and “Exchange” attributes, where “Name” can be anything you like (SAMaccountname? displayname?), but “Exchange” is the Exchange alias of the selected users.

I just created a custom view in the AD users and computers with the display name and exchange alias. Then exported this to a file, opened it with excel, editted the top (title) line to have the names “Name” and “Exchange”, and saved it as a CSV. Make sure it saves the CSV with COMMA’s, for some reason excel exports COMMA separated files with semicolons instead of the commas.

Now, just run the script in the Exchange Management Shell, having the correct path to the CSV file specified, sit back and relax. After a while, the mailboxes are enabled, end users received the welcome e-mail, and the positive results are stored in the output file!

Leave a Reply

Your email address will not be published. Required fields are marked *