A) Adding events to a user’s calendar
1. Create a test mailbox and add the event(s) you want.
2. Run this command at the Exchange Powershell to export the user’s calendar to a PST file
New-MailboxExportRequest -Mailbox "testmailbox" -IncludeFolders "#Calendar#" -FilePath "\\myshare\events.pst"
3. Check the status of the export request. Once the request is 100% complete, proceed to the next step.
Get-MailboxExportRequest | Get-MailboxExportRequestStatistics
4. Import the calendar to the desired user’s mailbox
New-MailboxImportRequest -Mailbox "george" -IncludeFolders "#Calendar#" -FilePath "\\myshare\events.pst"
Note: to import the events for a large number of users, use this script
5. Check the status of the import request. The events will show up in user’s calendar when the request is 100% complete. This may take a minute or two, depending on the number of events being imported, and the number of existing events in the destination mailbox.
Get-MailboxImportRequest | Get-MailboxImportRequestStatistics
6. Clean up the export and import requests
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest -Confirm:$False
Get-MailboxImportRequest -Status Completed | Remove-MailboxImportRequest -Confirm:$False
B) Removing events from a user’s calendar
1. Determine the subject of the event you want to remove, then run the following command. In my example, the subject of the event is “buy lunch for george”
Search-Mailbox -Identity "george" -SearchQuery 'Subject:"buy lunch for george"' -DeleteContent -Confirm:$False
Leave a Reply