Most companies, if not all, have their own set of holidays on top of national ones. So, distributing them is a pretty common task for an Office 365 / Exchange admin. There are different approaches out there with their own pros and cons. I’ve come up with two methods that combined give me a great result.
In this post let’s focus on the 2nd method – a bulk one.
I came up with this method after doing the migration from IBM Domino to Office 365. It looks complicated but after doing it several times you’ll get comfortable and it won’t be taking much time anymore.
To see more about the 1st method (manual), please follow this link – Add corporate or custom holidays to user calendars – 1st method – manual
1) Download and install (please use default settings) Azure Storage Explorer
2) Prepare a .csv file with all accounts using the following template – https://docs.microsoft.com/en-us/office365/securitycompliance/use-network-upload-to-import-pst-files#step-4-create-the-pst-import-mapping-file
In our case that .csv file should look like this:
To get a list of all emails use this PowerShell script:
Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName,PrimarySMTPAddress | Export-Csv -Path "C:\Temp\emails.csv"
This PowerShell script will output all email addresses including shared mailboxes and resources. If you don’t want to add corporate holidays to those, either adjust the script or filter the output of the current one.
3) Prepare a .hol file that contains all Contoso Holidays for the year required – this post Add corporate or custom holidays to user calendars – 1st method – manual shows how to do that.
1) Create a new temp user in Office 365 Admin. Any name would work. Assign a license so that this temp user has got a mailbox. If assigning a license is not an option, you can create a shared mailbox instead and work with it.
I would highly recommend using a temp user because we need a .pst file with a fresh calendar that has nothing but Contoso Holidays that need to be distributed. Using your personal calendar might pull some other events that must not be added to other users’ calendars.
2) Configure that new temp user’s profile in the Outlook.
3) Add Contoso Holidays to temp user’s calendar by opening a .hol file. Please see how to prepare such a file in this post – Add corporate or custom holidays to user calendars – 1st method – manual
4) Export temp user’s calendar into calendar.pst file using Outlook built-in functionality.
5) Go to Microsoft 365 admin center – Admin centers – Security & Compliance – Data governance – Import (https://protection.office.com/?rfr=AdminCenter#/import), then:
- Click on New import job
- Name your job (e.g. contoso-holidays-2019) – Next
- Select Upload your data – Next
- Press on Show network upload SAS URL in the step 2
- No need to close that dialog window
This link is valid for 1 month. Please save it somewhere as it will be used later.
6) Upload calendar.pst to Azure Cloud Storage using Azure Storage Explorer:
- Run Azure Storage Explorer
- Click on Add Account
- Select Use a shared access signature URI
- Paste the link without quotes from step 5 into URI field
- Click on Next, then Connect
- Go to Local & Attached – Storage Accounts – (SAS-Attached Services) – Blob Containers – ingestiondata
- Click on Upload – select your calendar.pst file – then click on Upload with the rest settings by default
- Make sure your calendar.pst has been successfully uploaded
7) Go back to Import page in step 5 where we left and check both I’m done uploading my files and I have access to mapping file, then Next.
8) Select a mapping file (Prerequisites – step 2) and then Validate it.
9) Once validated Save the job. Wait till it’s processed by Microsoft Exchange. Then it will be ready for import.
10) When ready, find and open your job. Click on Import to Office 365.
11) Select No, I want to import everything, then Next.
12) Click on Import data.
13) Wait till the Import is done and check the results. If everything is done properly, the number of imported items must be the same as the number of Contoso Holidays for that year for each mailbox. Notify everyone if needed.
Please note, it takes about 1 day for Microsoft to import data. However, the process is highly paralleled so it shouldn’t be an issue to add those holidays to hundreds or even thousands of mailboxes.
14) Once everything is done, delete the temp user from Office 365 and remove its profile from Outlook.
15) Run the following PowerShell script to disable Retention Hold:
Get-Mailbox -ResultSize unlimited | Set-Mailbox -RetentionHoldEnabled $false
Important!!! Because this whole method uses the same mechanism that’s used for migrating/importing data, it puts all processed mailboxes into Retention Hold state. That means none of your retention policies will work unless you disable Retention Hold.
- No users’ action is required
- Can be done at any time during the week
- Hundreds or thousands of mailboxes can be processed at once
- Takes about 1 day for Microsoft to import data
- Some preparation work is needed