Friday, March 28, 2014

Remove Exchange 2007 Public Folder Database After Exchange 2013 Migration

After I was done performing a migration from Exchange 2007 to Exchange 2013, I received the following error when trying to remove the public folder database from the Exchange 2007  EMC:
Object is read only because ti was created by a furture version of Exchange: 0.10 ( Current supported version is 0.1 (8.0.535.0).
Ok. No problem. I'll just remove this from the Exchange 2013 side. However, I found that shell in Exchange 2013 does not have the Remove-PublicFolderDatabase cmdlet.

The only fix I found was to remove the public folder database by using ADSI Edit. You can find the public folder database in the following path in ADSI Edit:
  • Configuration\Services\Microsoft Exchange\OrganizationName\Administrative Groups\Exchange Administrative Group (FYDIBOHF23SPDLT)\Servers\ServerName\InformationStore\StorageGroupName\PublicFolderDBName
 After removing the public folder object, I could delete the storage group and uninstall Exchange 2007.

At this point, in the event log, I was seeing errors for the mailbox databases on the Exchange 2013 side like this:
Source: MSExchange ADAccess
Event ID: 2937
Process MSExchangeMailboxAssistants.exe (PID=XXX). Object (mailboxdatabase). Property [PublicFolderDatabase] is set to value [domain/Configuration/Deleted Objects/DatabaseName, it is pointing to the Deleted Objects container in Active Directory.

In Exchange 2013, the property is not used and you can't set the value to $null by using the Set-MailboxDatabase cmdlet. So, the fix is to yet again go into ADSI Edit and manually remove the value from the property in the mailbox database object as shown in the graphic below. Note that the property you edit is msExchHomePublicMDB.

The path to the mailbox databases is:
  • Configuration\Services\Microsoft Exchange\OrganizationName\Administrative Groups\Exchange Administrative Group (FYDIBOHF23SPDLT)\Databases\DatabaseName

Tuesday, March 25, 2014

Find Unused Exchange Mailboxes

Every once in a while you need to identify mailboxes that are no longer in use. This PowerShell command will find any mailbox where no one has logged on to the mailbox for 60 days.

Get-Mailbox | Get-MailboxStatistics | Where-Object {$_.LastLogonTime -lt (Get-Date).AddDays(-60)}

You can use this information to further investigate whether these mailboxes are required.

If the LastLogonTime is $null (blank) it means that the user has never logged on. This is normal for shared mailboxes and resource mailboxes.