Office 365 Voicemail Export Tool

Contents

Overview. 1

Command line options. 2

First time setup. 3

Registry edit may be necessary. 3

Impersonation Setup. 3

Requirements/Special Notes. 3

Revision History. 3

 

Overview

 

The Office 365 Voicemail Export Utility is a CLI application that allows you to export information about your Exchange mailbox users (including their recorded greetings and voice messages), contacts and groups (both distribution and o365).  Information is output into a local folder you specify and can be used to import into a Unity Connection voice messaging system using the accompanying import tool.

User, contact and list information is provided in a simple text JSON format and emails are output in standard PST files so you can use the export content for your own purposes reasonably easily.  The command line options let you choose what you’d like to export and where you want the output, see the next section for details.

NOTE: You do need to do a couple things on the client machine you’re running on the tool and configure the user you’re logging in with for impersonation rights – see the First Time Setup section for details.

Command line options

If you just run the executable the list of options and their meaning is provided at the command line as well.

       

a:IncludeCallAnswerRules

Include call answer rules.  Defaults to false

b:BackupTarget

Backup folder for items to be stored in, full path. Required.

c:IncludeContacts

Include contacts in backup.  Defaults to true

d:MaxMessageDaysOld

Max message age to include from 1 to 999 days. Defaults to 60

f: UsersFromCsvFile

Select users by SMTP address from csv file found at full path provided.  The CSV file must have a header row at the top and one of the columns must be named “SMTPAddress”.

g:IncludeGreetings

Include greetings for users in backup.  Defaults to true.

i:ImpersonationSetup

Run scripts to grant admin user impersonation rights in Exchange - only needs to be run once. Defaults to false.

l:IncludeLists

Include distribution and o365 lists in backup.  Defaults to true

m:MaxUsers             

Max users fetched from directory. Defaults to all users

n:LoginName

User name to log into o365 as (full email address). Required.

o: OnlyUmUsers

The users selected (either by all or via CSV) will only be searched among Unified Messaging users in the system, not all users in Active Directory.

p:Password

Password to use logging into o365. Required.

v:IncludeVoiceMail

Include voicemail in backup. Defaults to true

u:DebugOutput

Includes much more information in the log output including EWS traces and full PowerShell command output.  Does affect performance so only use when necessary.

 

Examples:

·         Backup all contacts, lists and users including greetings and 60 day old voicemails and newer:

O365VoicemailExport -b d:\mailexport -n adminguy@domain.onmicrosoft.com -p mypw

·         Backup the first 25 users, no contacts, no lists

O365VoicemailExport -b d:\mailexport -n adminguy@domain.onmicrosoft.com -p mypw -c false -l false –m 25

·         Backup only users and get voicemails 120 days old and newer

O365VoicemailExport -b d:\mailexport -n adminguy@domain.onmicrosoft.com -p mypw -c false -l false -d 120

·         Get all contacts, lists and users but skip greetings and voicemail backup

O365VoicemailExport -b d:\mailexport -n adminguy@domain.onmicrosoft.com -p mypw -g false -v false

·         Setup o365 login account for impersonation rights necessary to run correctly

O365VoicemailExport -b d:\mailexport -n adminguy@domain.onmicrosoft.com -p mypw -i

 

First time setup

Before running this application you will need to install two things into the PowerShell environment on your x64 bit Windows 10 client.

First, you need to install Microsoft Online Services Sign-In Assistant for IT Professionals RTW. 

Once that is installed you need to run PowerShell “as administrator” and execute this command:

Install-Module MSOnline

During the course of the MSOnline module installation you may be asked to also install an update NuGet library, permission to install from an “untrusted library” (it’s Microsoft) and other related items – you will need to respond “Yes” to all of these.  Once it’s completed you can make sure it worked by typing this command into PowerShell:

Import-Module MSOnline

It should run without issuing any error.

Note that the first time you run the tool it will check that these needed libraries are installed on the local machine and will warn you if they’re not.

Registry edit may be necessary

In rare cases if you’re running on a machine that has a restrictive group policy applied, you may need to manually edit the following registry key (which should already be present on your system)

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client

AllowBasic

If the value for “AllowBasic” is 0 you need to set it to 1.

Impersonation Setup

In order to export voice messages and recorded greetings for unified messaging users the account you’re using must be configured to allow it to “impersonate” other users in your organization.  The application will do this for you if you run with the “-i” option – this will configure everything you need and only needs to be run once for your Office 365 domain.  Running this multiple times is not necessary but will not hurt anything, however it will report errors indicating the configuration has already been done.

Requirements/Special Notes

Only Windows 10 x64 has been tested.  Microsoft’s support for 32 bit versions of PowerShell is ending soon, so if you’re still running x32 at this point it’s probably time to upgrade.

Other versions of Windows such as Server 2016 will be tested at a future time.  Earlier versions of the workstation version will not be supported, Windows 10 is required.  You are free to try it on earlier versions but you wont receive support.

You must run the tool “as administrator”. 

Revision History

1.0.6 – 11/3/2018

·         Updated greeting export logic to handle unknown greeting class designations in the file name creation

1.0.5 – 11/2/2018

·         Added –o option to filter out only UM users

·         Added –f to load a CSV file containing SMTP addresses of users to search for

1.0.4 – 10/27/2018

·         Added –a option for including the Call Answer Rules for UM users that have them.

·         Added –m option to limit the Maximum Users fetched instead of always getting all users in the directory

1.0.2 – 9/3/2018

·         Updated logic to not included non licensed user data in backup

·         Added the full internet message id for messages to the backup file name instead of truncating it which caused conflicts in some cases.

1.0.1 – 7/2/2018

·         First release for beta testing