Exporting public folder calendars to resource mailboxes
I got a task to come up with a method to import resource calendars in public folders to resource resource mailboxes instead. A lot of the methods I found online involved a lot of manual hand cranking, and that’t not viable for 100s of calendars.
The outlook com-object didn’t get me far so I started digging around the EWS API, and an hour or two later - it was finished.
- Github link to script
- You need to install the EWS API before running this script.
- You need to have permission to change permissions for the ‘-ResourceMailAddress’ in Office 365.
- The account used for ‘-ExchangeCredential’ needs to be able to read/write to the public folder calendar.
How to use it
First, create the resource mailbox that you want to migrate to. After the resource is created, run the script:
Note: ExchangeCredential and Office365AdminCredential can be the same
There are some limitations to this script:
- The organizer might have a hard time cancelling appointments.
- A theoretical workaround is to CC the cancellation to the resource mailaddress but i haven’t tested this yet.
- If an organizer don’t have a mailbox anymore, the copy will fail.
- Cancelling copied appointments with ‘[Microsoft.Exchange.WebServices.Data.DeleteMode]::HardDelete’ in EWS will send a cancellation to all attendees… I noticed.