Wednesday, May 27, 2015

failed to uninstall last Exchange 2013

If you have to uninstall the first and last Exchange 2013 server in your org and failed with following errors:

Error:Uninstall can't continue. Database Mailbox Database XXXXXXXXX1 : This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes. To get a list of all mailboxes in this database, run the command Get-Mailbox -Database . To get a list of all mailbox plans in this database, run the command Get-MailboxPlan. To get a list of archive mailboxes in this database, run the command Get-Mailbox -Database -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database -Arbitration. To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox . To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox -Archive. To disable a public folder mailbox so that you can delete the mailbox database, run the command Disable-Mailbox -PublicFolder. Arbitration mailboxes should be moved to another server; to do this, run the command New-MoveRequest . If this is the last server in the organization, run the command Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration mailbox.

This is because you have one of the following:
  • Still have folders in your Public Folders
  • Still have Mailboxes in your Mailbox Datbases
  • Still have Mailbox Databses
Exchange 2013 uses a number of different types of mailboxes as seen below. Even if you have removed all of your users mailboxes you must still remove these mailboxes:

DISCOVERY MAILBOX
DiscoverySearchMailbox {D919BA05-46A6-415f-80AD-7E09334BB852}
MONITORING MAILBOXES
HealthMailbox62256620620346798029c55bfe0fcc5d
HealthMailboxb67c72c285f54c30bad37dd37eec361a
HealthMailbox721771958fa64a53aa78527c02caf55b
HealthMailbox995793b82c2c4a14b6173e54371179ec
HealthMailboxc8603cb9bb41442e8b402db42f93dc16
ARBITRATION MAILBOXES
SystemMailbox{1f05a927-c403-4250-9f07-c5e43605c1ac}
SystemMailbox{bb558c35-97f1-4cb9-8ff7-d53741dc928c}
SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}
FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042
Migration.8f3e7716-2011-43e4-96b1-aba62d229136

These mailboxes must be removed before you can actually uninstall Exchange 2013  You can remove these mailboxes from the ECP however if you you may need to use the command below to allow you to remove the arbitration mailoxes, this command allows you to disable them
Get-Mailbox -Arbitration -Database <MailboxDatabase> | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed
Replacing the Mailboxdatabase information with your own. Once removed if you start to unistall Exchange 2013 the uninstallation should complete

and last

Get-mailbox  -Database <mailboxdatabase > |disable-mailbox

after that try to uninstall your Exchange 2013 server again.

Good Luck!

Thursday, April 2, 2015

How to check DAG Replication Status

get-DatabaseAvailabilityGroup USDAG-10 | %{ $_.Servers | %{ GetMailboxDatabaseCopyStatus -Server $_ } }

Friday, March 20, 2015

Exchange 2010 How to re-index mailbox database

 Note: Do the below if it happens all users on the DB. If just for one user, move the user to other DB to see if the issue is gone.

Exchange 2010 re-index mailbox database
Users may report that searching Outlook for non-cached or online mode mailboxes isn't getting the right results or not returning results past a certain date. Also OWA may return "The action couldn't be completed.  Try again later." when trying to search. You need to reindex your mailbox database(s). 
1. Run Repair-ExchangeSearchSymLinks.ps1. It isn't included in the normal scripts folder under the Exchange program files, you can copy this to a text document and save it as Repair-ExchangeSearchSymLinks.ps1.
01write-host "Attempting to repair symbolic links"
02 
03write-host "Stopping msftesql-exchange and msexchangesearch services"
04stop-service -Force msexchangesearch
05stop-service -Force msftesql-exchange
06 
07$rval = get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Setup -ea SilentlyContinue
08if(!$rval)
09{
10 add-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Setup -ea SilentlyContinue
11}
12 
13write-host "Installing symbolic links"
14Install-ContentIndexingService –HubOnlyFilterRegistration
15 
16if(!$rval)
17{
18 Remove-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Setup -ea SilentlyContinue
19}
20 
21write-host "Starting msftesql-exchange and msexchangesearch services"
22start-service msexchangesearch
23start-service msftesql-exchange
24 
25write-host "Symbolic links restored."
26write-host "Please run test-exchangesearch to verify installation."
Or you can get it from Microsoft here if you don't trust me and place it in the Exchange Server\V14\Scripts folder. Open Exchange Management Shell (remember you might need to run EMS elevated and run Set-ExecutionPolicy Unrestricted first), change path to the scripts folder then run:
.\Repair-ExchangeSearchSymLinks.ps1
 
2. Next run the ResetSearchIndex.ps1 script, this one is included in the Exchange program files scripts folder so no need to download. You can run it against a specific database or against all of them as per the commands below:

.\ResetSearchIndex.ps1 -All    .\ResetSearchIndex.ps1 databasename
 
You should see event id 109 for each database stating that an index has been created and sometime later event id 110 for each database as the indexing finishes.

Thursday, March 19, 2015

How to: Move Catalog Data in Exchange 2010

How to: Move Catalog Data in Exchange 2010
 
 
When you've moved an mailbox database, the old catalog data is still present on the old partition. This prevents deleting the specific partition. When you try to delete those files, you receive this error.
 
Error description:
The Catalog data folder stays in place after a database move path action. The folder couldn't be cleaned up because it is in use by the Microsoft Exchange Search Indexing service
 
Solution:
First we have to temporarely disable the indexing on the particular mailbox database. Then we stop the indexing service of Exchange so we can delete the remaining files. The last step is to enable the indexing again.
 
Actions:
You can follow the next steps.
 
- Open the Exchange Management Shell and run the following command:

         Set-MailboxDatabase -Identity databasename -IndexEnabled $false

 -Before moving / cleaning the catalog files, stop the service Microsoft Exchange Search Indexer
         - Move the catalog files to the new database location or clean them up.
         - Start the service Microsoft Exchange Search Indexer
        - Open the Exchange Management Shell and run the following command:

    Set-MailboxDatabase -Identity databasename -IndexEnabled $true

Thursday, February 26, 2015

how to get mailbox counts per Mailbox Database quickly

How to get mailbox counts per Mailbox Database quickly

get-mailbox -resultsize unlimited | group-object -property Database -noelement