Delete calendar meetings in a Mailbox using PowerShell – Exchange

In this post we are going to look at using PowerShell to search and delete specific or all calendar meetings and appointments in an Exchange Mailbox.

Using the Exchange Management Shell or remotely connecting to the Exchange Server in PowerShell.

Query Results –

You can use the below command to firstly check to see how many meetings are currently setup in the mailbox.

-SearchMailbox -identity “UsersMailbox” -SearchQuery kind:meetings -EstimateResultsOnly

Delete all-

Then once you are happy to proceed to the actual deletion of the scheduled meetings you can use the same command just amended to include -DeleteContent instead of -EstimateResultsOnly

-SearchMailbox -identity “UsersMailbox” -SearchQuery kind:meetings -DeleteContent

Refined search and deletion –

To search for a specific meeting rather than purging a mailboxes entire calendar, you can use the variety of search options available to fine tune your search.

For instance, querying both the kind of object and the subject, I can search and delete specific meeting or appointments

Search-Mailbox -identity “UsersMailbox” -SearchQuery kind:meetings,subject:”Tea Party at 5!” -DeleteContent

Example –

Powershell Calendar

Additional search properties to refine the query-

Although the table focuses more on emails rather than calendar meetings or appointments,  it can be used all the same.

Property Example Search results
To to:”Ben Smith”
to:bsmith
to:besmith@contoso.com
Message sent to Ben Smith
Cc cc:Graham Smith
cc:Smithg
cc:Smithg@contoso.com
Messages with Graham Smith in the Cc field.
From from:Matt Hays
from:Matth
from:Matth@contoso.com
Messages sent by Matt Hays
Keywords in retention policy retentionpolicy:business critical Messages that have the Business Critical retention tag applied.
Date when messages expire according to policy expires:4/2/2014 Messages that expire on April 2, 2014.
Sent sent:yesterday All messages sent yesterday.
Subject Subject:”conference” All messages where the phrase “conference” appears in the Subject field.
Attachments attachment:report.pptx Messages that have an attachment named report.pptx. The use of attachment:report or attachment:rep* returns the same results + anything else starting with “rep”

Hope this is helpful!

 


Thanks for reading – feel free to follow and stay updated 🙂  View sysadminguides’s profile on Facebook View GuidesSysadmin’s profile on Twitter View 115372466162675927272’s profile on Google+

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s