Categories
Tech

Outlook to Google Calendar Sync

Ah, the travails of academia. Like many universities, USC uses Microsoft Outlook as its email and calendar provider. This presents some integration challenges for those of us, like me, who use Google Calendar everywhere else in life. It’s effectively impossible to sync an Outlook Calendar with a Google Calendar, so I had to juggle between both when trying to schedule anything. Chaos ensues.

So, I created a script to perform an ongoing one-way sync from my USC Microsoft Office 365 Outlook calendar to my personal Google calendar, handling new, updated, and deleted events. I had to develop my own solution because Microsoft/Google inexplicably can’t get their own acts together. For example, you can publish your Outlook calendar’s ICS URL and add it to Google, but it only syncs roughly once per day so you miss any new appointments in the meantime. Microsoft Flow used to work (clumsily) for syncing, but even their official recipes are now broken. So I had to roll my own.

I made my Python solution open-source for anyone else to reuse if you have the same problem I did. It’s available on GitHub along with some setup instructions. A few notes… first, you need access to a server: either your own, or AWS, or a VPS, or whatever. Second, you’ll need to create Google and Microsoft API access tokens. Third, you’ll need to install the Python packages in requirements.txt and set up a cronjob to run the script periodically. Mine runs every 15 minutes.

See the GitHub repo for instructions, details, and code.

One reply on “Outlook to Google Calendar Sync”

Have you thought about turning this into a Google Apps Script so it can run in your Google account every 15 min without the need for a personal server?
This article shows how to do it for syncing 2 Google Calendars. Maybe there’s a way you could leverage your own code to modify the script in the article to sync an Outlook Exchange Calendar to a Google Calendar?
Original article with script for one-way Gcal to Gcal sync: https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
Enhanced script for two-way Gcal to Gcal sync: https://gist.github.com/alranel/f1c9b7abb9013f4a39aa4fb12f6de4ef

I haven’t figured out a way to do an Exchange to Google Calendar sync via a Google Apps Script as I’m only technical enough to make minor tweaks to the code of others.

Leave a Comment