Enable Unified Messaging Office 365 using PowerShell

Scenario:

Enable Unified Messaging Office 365 using PowerShell.

Unified Messaging is a feature that you have to enable through your Exchange server OnPremise or Exchange Online, on the mailbox site. The next information has been extracted from Microsoft’s website. When you deploy Unified Messaging, users can access voice mail, email, and calendar information that’s located in their mailbox from an email client, for example, Outlook or Microsoft Outlook Web App, from a mobile phone with Microsoft Exchange ActiveSync set up, such as a Windows Phone, or from a telephone.

In general the script will automatically enable Unified Messaging to all Skype for Business telephony users. I have configured the script to run on a schedule basis every night to enable Unified Messaging to all user mailboxes that they are suppose to have it enabled. The script connects on both Active Directory and Exchange Online to perform the process.

Let check what the script does in more details

First the script will retrieve the credentials that will be used through out the process. Two different credentials are used. The first one is the admin account that will connect on Office365 and enable Unified Messaging. The second account is the account that will be used to send the email reports at the end of the process. Then the script connects on Office365 and collects all users that Skype for Business telephony is enabled and adds the mailbox in a variable.

For each user that has been added in the variable, the script will check the mail value and if Unified Messaging is enabled. If Unified Messaging is not enabled the script sets some variables based on the telephony configuration of the user within Skype for Business. These variables are used later to enable Unified Messaging on the mailbox. After the feature (Unified Messaging) has been enabled, the script will check again the status of Unified Messaging and will keep it in a variable to be used in the reporting.

Reporting

After the process has been completed, the script will provide a report on which mailboxes, unified message has been enabled. The email report will include the mailbox name that there was a change on unified message , the status of unified message before and after the change. The reason that I use before and after status, is that sometimes it might be an issue while enabling unified messaging and the status will remain to false. An error report is also configured, if there are any errors or exceptions during the run of the script. All errors or exceptions will be send if there are any. If there is no change made by the script, then no email report will be send.

You can download the script here or copy it from below.

Hope you will like the script and leave your comments below. If you want to ask anything do not hesitate to contact me or comment below.

Related Links:

Solution / Script: