A recent case brought up the question of whether it is possible to import calendar items into a mailbox from a text file using PowerShell. While there aren’t any cmdlets built-in that support this, it is certainly possible to implement this using PowerShell and the EWS Managed API. Sample script is attached, and the syntax is:
Import-CalendarCSV -CSVFileName <string> -EmailAddress <string> [-Username <string> -Password <string> [-Domain <string>]] [-Impersonate <bool>] [-EwsUrl <string>] [-EWSManagedApiPath <string>]
Filename of the CSV file to import appointments for this user from.
Mailbox SMTP email address
Username for the account being used to connect to EWS (if not specified, current user is assumed)
Password for the specified user (required if username specified)
If specified, used for authentication (not required even if username specified)
Set to $true to use impersonation.
Forces a particular EWS URl (otherwise autodiscover is used, which is recommended)
Full and path to the DLL for EWS Managed API (if not specified, default path for v1.1 is used)
To process the CSV file c:\calendar.csv and import all entries into the mailbox of email@example.com, you would use the following command:
Import-CalendarCSV -CSVFileName c:\calendar.csv -EmailAddress firstname.lastname@example.org
The CSV needs to be in the format Subject, Start Date, Start Time, End Date, End Time.
Other fields can be added, and if this is the case you will need to add a header row to the CSV file. The headers need to include the five required fields (Subject, Start Date, Start Time, End Date, End Time) and any other fields you like. You should be able to use any of the fields listed here as additional fields, so long as they are simple (i.e. just contain a single value); this means that you can’t specify Attachments, for example.