We were inspired by a ticket I entered three years ago that never got any traction, despite it being a major pain point for employees. We all know that conference rooms are a precious commodity here at Wayfair, and few things are more frustrating when searching for a room than finding empty rooms that are reserved, especially when the people that reserved them left the company weeks or months ago.

What it does

This Powershell script utilizes the Exchange Web Services API and mailbox impersonation to retrieve all meetings from an employee's calendar, and then iterates over each meeting, applying Clever Logic to determine whether the meeting should be cancelled (or if cancelling the meeting would potentially ruin someone else's day).

How we built it

We used our team's Powershell experience and our knowledge of how different business units function to come up with criteria for meetings that should be cancelled (and meetings that shouldn't be cancelled), and then tested our script against our own mailboxes.

Challenges we ran into

  • A lot of the more readily-available methods for clearing out meetings leave a lot to be desired. The simple, straight-forward way to do this would be to just delete orphaned meetings from the room calendars, right? Unfortunately, this would still leave the meetings intact on the calendars of all other attendees. The EWS API is a newer option that's more powerful, but unfortunately has less documentation available.
  • Most of the documentation for the EWS API is written for people coding in C or C#, which is slightly less than helpful when we're writing our script in Powershell.
  • We had to work out some logic for what meetings should be cancelled and which shouldn't. We decided we're most interested in recurring meetings (rather than one-offs) that include 15 or fewer people and don't include any external attendees (meetings with attendees that don't work at Wayfair will be gathered into a list which will be emailed to the employee's manager so they can follow up if necessary). We'll also be extra cautious and not touch calendars belonging to people who might be booking meetings on someone else's behalf, like the Admin team.

Accomplishments that we're proud of

We think we came up with some pretty badass logic that will avoid cancellation of meetings that shouldn't be cancelled, while also cancelling a lot of meetings that would otherwise clog up our conference rooms.

What we learned

Exchange calendars are complicated as heck.

What's next for Meeting Automatic Removal/Cancellation

Code review, then hopefully implementing this as part of the employee termination process.

Built With

  • powershell
  • ews
  • unicorn-dust
Share this project: