EWS script to create an appointment in a set of mailboxes defined in a CSV file using an impersonation account
A customer recently wanted a script that would allow him to create an appointment with a reminder in a set of mailboxes that he defined in a CSV file. I was happy to oblige and this is the result. My script is based off of http://mikepfeiffer.net/2011/01/creating-calendar-items-with-powershell-and-the-ews-managed-api/. I wanted to post my script as it does do a couple of things differently:
- has reminder support
- has free/busy status support
- it's a script rather than a cmdlet
- has logging so you know against which mailboxes the script worked
- it's been validated against Office 365
To run the script, you must:
- Allow execution of unsigned PowerShell scripts: Set-ExecutionPolicy unrestricted
- Install the EWS Managed API 2.2 from http://www.microsoft.com/en-us/download/details.aspx?id=42951
- Create an impersonation account using https://msdn.microsoft.com/en-us/library/office/dn722376%28v=exchg.150%29.aspx
- Create a CSV file where one of the columns has a header named EmailAddress
- There should be no throttling concerns as impersonated actions are counted against the target user's throttling policy rather than the impersonation account.
- This script should work against any modern versions of Exchange.