Identifying Large Calendar Items

I have been seeing some scary behavior lately. The environment is Exchange Server 2010 SP1 RU5. Basically, what is happening is that a calendar item is updated too often (against Microsoft’s clear Best Practices) and becomes corrupt. The corrupt calendar item then causes excessive Database and Transaction Log growth. What makes this an ugly situation is that the user’s mailbox does not grow, and finding the user and the offending calendar item is very difficult.

Actually, finding the offending user isn’t too difficult since you can use ExMon to see that a user is consuming the majority of the resources. Finding the actual item is a bit more difficult.

Anyway, I have requested that Microsoft provide us with a PowerShell script that can be run on a regular basis to help identify Calendar items that have been updated excessively so we can go to the user and help them delete the item and to create a new one to replace it and also take the time to discuss Best Practices. It appears that to get what I want will require some leveraging of the EWS API which is not something that I can do.

James Milford did provide a nice solution that kind of meets my needs. I was not aware of the –IncludeAnalysis option for the Get-MailboxFolderStatistics. The resulting one-liner will identify the largest Calendar item in each person’s mailbox assuming that the item is over 5 mb. While a particular user may have many large items, at least this script will find their largest item.

Get-Mailbox | Get-MailboxFolderStatistics –FolderScope Calendar –IncludeAnalysis | Where {$_.TopSubjectSize –gt 5000000}| Select Identity,ItemsInFolder,TopSubject,TopSubjectSize | Export-Csv LargeCalendarItems.csv –notype

Your mileage may vary when it comes to how long this takes to run as the more mailboxes that you have in your Exchange organization, the longer it will take.

Advertisements
This entry was posted in Exchange. Bookmark the permalink.

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