Don’t forget to disable CRA (Calendar Repair Assistant) before the mailbox migration

If you are in the Calendar sync coexistence scenario during migration into Exchange 2010/2013, CRA (Calendar Repair Assistant) can cause a lot of troubles in terms of duplicate Calendar items. It’s your friend before and after the migration, but you really want to disable CRA while migration is under way. Primarily it needs to be disabled in the Target which starts with the stub mailboxes having empty Calendars and then being gradually populated with data. But disabling it in Source becomes equally important as you start switching user mailboxes and Target also becomes originator of new Calendar appointments.

In Ex 2010 RTM CRA is disabled by default, in Ex 2013 it’s enabled out of the box! Here are parameters of our interest, somewhat brain twisting to understand what exactly they do, I must tell you. But to stop the damage, just reset them all to $null. It’s important to disable it across the entire Exchange environment (on all mailbox servers) because when it checks just one mailbox, it may end up finding and linking the problematic Calendar item to one of the other mailboxes being migrated.

From TechNet, Ex 2010  SP3/ and 2013

“CalendarRepairWorkCycle and CalendarRepairWorkCycleCheckpoint   These parameters work together. The CalendarRepairWorkCycle parameter specifies the time span in which all mailboxes on the specified server will be scanned by the CRA. For example, if you specify seven days for this parameter, the CRA will process all mailboxes on this server every seven days. Calendars that have inconsistencies will be flagged and repaired according to the interval specified by the CalendarRepairWorkCycleCheckpoint parameter. For example, if you specify one day for this parameter, the CRA will query every day for new mailboxes that require processing.”

Ex 2010:

“The CalendarRepairSchedule parameter specifies the intervals each week during which the Calendar Repair Assistant applies checks for calendar failures. The format is StartDay.Time-EndDay.Time. You can use the following values for the start and end days

•Full name of the day
•Abbreviated name of the day
•Integer from 0 through 6, where 0 = Sunday
The start time and end time must be at least 15 minutes apart. Minutes are rounded down to 0, 15, 30, or 45. If you specify more than one interval, there must be at least 15 minutes between each interval.

The following are examples:

•”Sun.11:30 PM-Mon.1:30 AM”
•6.22:00-6.22:15 (The assistant will run from Saturday at 10:00 PM until Saturday at 10:15 PM.)
•”Monday.4:30 AM-Monday.5:30 AM”,”Wednesday.4:30 AM-Wednesday.5:30 AM” (The assistant will run on Monday and Wednesday mornings from 4:30 until 5:30.)
•”Sun.1:15 AM-Monday.23:00″
If the Calendar Repair Assistant doesn’t finish processing the mailboxes on the server during the time that you’ve scheduled, it automatically resumes processing where it left off the next time it runs.”
Note the following: “In Exchange 2010 Service Pack 1 (SP1), the CRA was changed from a time-based assistant to a throttle-based assistant“. So CalendarRepairSchedule no longer tells if it’s enabled or disabled. Use -CalendarRepairMissingItemFixDisabled $true instead.

EXCHANGE 2013

To check if CRA is enabled on any servers (screenshot example reveals one mailbox server where it was enabled):

Get-MailboxServer | Select Identity,CalendarRepairWorkCycle,CalendarRepairWorkCycleCheckpoint,CalendarRepairMode

a1sx2_Original1_2015-03-21_0-45-17

To disable CRA schedule on all servers and to set repair mode to the non-intrusive option:

Get-MailboxServer | Set-MailboxServer –CalendarRepairWorkCycle $null -CalendarRepairWorkCycleCheckpoint $null –CalendarRepairMode ValidateOnly

EXCHANGE 2010 RTM (options vary per Service Pack level):

To check if CRA is enabled on any servers (screenshot example reveals many mailbox servers where it is enabled):

Get-MailboxServer | Select Identity,Calendar*

a1sx2_Thumbnail1_2015-03-21_11-50-27

EXCHANGE 2010 SP1 and later

2015-08-28_13-22-29_20150828-162557_1

To disable CRA work cycle and schedule on all servers:

Get-MailboxServer | Set-MailboxServer –CalendarRepairWorkCycle $null -CalendarRepairWorkCycleCheckpoint $null –CalendarRepairSchedule $null -CalendarRepairMissingItemFixDisabled $true

IF YOU GET IN TROUBLE AND NEED TO RE-SYNC CALENDARS, here is a good way of emptying out just the Calendar content inside the mailbox:

1. Estimate what you are going to delete
Search-Mailbox –identity username –SearchQuery kind:meetings –EstimateResultOnly

2. Delete (from passive mailbox side)
Search-Mailbox –identity username –SearchQuery kind:meetings –DeleteContent

3. Re-Sync