Users within an enterprise organization (typically based on their nationality/location) have the option of adding Holidays to their calendar using an Outlook client. If using Outlook 2010, they can open the backstage center, click “Options” and then “Calendar”. Here we find the “Add Holidays…” button.
This is an acceptable solution for most enterprise organizations, but there are situations where you wish to centrally add the Holiday to each users calendar. For instance, in some environments all users or a selected scare of users doesn’t have a thick Outlook client but instead relies on using Outlook Web App (OWA) as their primary e-mail client. As some of you probably know, the OWA client doesn’t allow the user to add Holidays to their calendar.
What to do then? Well, the “New-ExportRequest” and “New-ImportRequest” cmdlets comes to the rescue.
Here are the necessary steps:
- First create an empty user mailbox (in this example I call it ImportHolidays)
- Open the new user mailbox using an Outlook 2010 client
- Click “File” > “Options” > “Calendar”
- Under “Calendar”, click “Add Holidays…”
- Select the locations whose holidays you would like to add to the calendar (in this example I’m interested in adding Denmark)
- Click “OK”
Holidays for the selected location are now being imported
When they have been imported, click “OK”.
Now open an Exchange Management Shell on and type the following command:
Get-MailboxFolderStatistics “ImportHolidays” | FT Name, ItemsInFolder
As can be seen, we have imported 239 calendar items to the calendar folder.
Now it’s time to export the the calendar to a PST file.
By default no one is granted the permissions necessary to import and export data to and from mailboxes in Exchange 2010 SP1, not even users in the Exchange Organization Administrator role group. So before continuing, we need to assign the user or group that we want to grant the necessary permissions to the “Mailbox Import Export” management role.
For instance, to assign the management role to the Administrator account (not really recomemend. You should grant it to a group really), we would use the following command:
New-ManagementRoleAssignment -Name “Import Export Mailbox Admins” –User “Administrator” -Role “Mailbox Import Export”
We can now export the Calendar items of the ImportHolidays mailbox to a PST file using the following command:
New-MailboxExportRequest –Mailbox “ImportHolidays” -FilePath \\EX02\PSTs\ImportHolidays.pst –IncludeFolders “#Calendar#”
The export request should complete in a few seconds.
Now pick a mailbox to import to which you wish to import the Holidays. Run the following command to check how many items that are in the calendar folder of the respective user:
Get-MailboxFolderStatistics “SAlexander” | FT Name, ItemsInFolder
In this example the user has 4 items.
Now run the following command to import the PST file to this mailbox:
New-MailboxImportRequest –Mailbox “SAlexander” -FilePath \\EX02\PSTs\ImportHolidays.pst –IncludeFolders “#Calendar#”
Again it should only take a few seconds to import the PST to a single mailbox. To very the import request has completed, run the following command:
Now let’s open an Outlook client and verify we can see the Holiday items in the calendar.
Now your next question would probably be how you import the Holiday items to user mailboxes in bulk? Well, to answer that question I recommend you check out my deep dive articles series (more specifically part 2) that explains how you use the New-MailboxImportRequest and New-MailboxExportRequest cmdlets introduced with Exchange 2010 SP1.
You can also use the above method in an Exchange 2007 or Exchange 2003 environment. However for Exchange 2007 you must use the “Import-Mailbox” and “Export-Mailbox” cmdlets (see this article) and for Exchange 2003 you would need to use the good old ExMerge tool.
Technology Architect/Writer/MS Vendor
MCM: Exchange 2007 | MVP: Exchange Architecture