Forum Discussion

Re: Delete all calendar appointments for a list of users using powershell

victor_fernande 

 

The problem with Remove-CalendarEvents is that it's forward looking and I suspect that you want to remove events in the past. This can be done with the Search-Mailbox cmdlet using a command something like this:

 

Search-Mailbox -Identity MailboxtoSearch -SearchQuery 'Received:01-Jan-2019..15-Dec-2020 kind:meetings' -TargetFolder Searches -TargetMailbox AnotherMailbox -LogOnly -LogLevel Full

 

This command looks for calendar meeting events in a certain date range and creates a report in the target folder in the target mailbox. If you want to delete the items, run: 

 

Search-Mailbox -Identity MailboxtoSearch -SearchQuery 'Received:01-Jan-2019..15-Dec-2020 kind:meetings' -DeleteContent

 

2 Replies

Resources