mercoledì 15 luglio 2020

Exchange - cancellazione mailbox database

Nel caso in cui si voglia cancellare un database di posta di Exchange e' necessario spostare tutte le caselle che esso ospita su un altro DB. Soprattutto se il database che volete cancellare e' quello nativo, dovete ricordare di spostare anche le "arbiration mailboxes"
Con il seguente comando e' possibile vedere le caselle di Exchange e su quale DB sono ospitate:
Get-Mailbox |ft name,alias,database

Con il seguente comando, invece, e' possibile vedere le arbitration mailboxes e su quale DB sono ospitate:
Get-Mailbox -arbitration|ft name,alias,database

Con il seguente comando e' possibile spostare le arbitration mailbox su un altro DB
Get-Mailbox -Database "Mailbox Database 1" -arbitration | New-MoveRequest -TargetDatabase "Mailbox Database 2"

Le arbitration mailbox sono tre in Exchange2010 e 5 Exchange 2013/2016. Se cancellate si possono ricreare, ma devono esserci.
Sono usate per vari scopi, come OAB, federazione tra exchange in differenti organizzazioni, moderazione ecc.

Verifica dei database montati
Get-MailboxDatabase -Status | Sort Name | Format-Table Name, Server, Mounted

Smontare il database
Get-MailboxDatabase -Status | Sort Name | Format-Table Name, Server, Mounted
Dismount-Database "Mailbox Database 1" -Confirm:$False

Cancellare il database
Remove-MailboxDatabase "Mailbox Database 1" (da powershell si puo rimuovere il DB senza smontarlo, da GUI bisogna fare i 2 passaggi)



FORMA VELOCE
Spostamento caselle
Get-MailboxDatabase "Mailbox Database 1" |Get-Mailbox |New-MoveRequest -TargetDatabase "Mailbox Database 2" -Confirm:$true
Get-MailboxDatabase "Mailbox Database 1" |Get-Mailbox -Arbitration | New-MoveRequest -TargetDatabase "Mailbox Database 2"
Get-MailboxDatabase "Mailbox Database 1" |Get-Mailbox -Monitoring | New-MoveRequest -TargetDatabase "Mailbox Database 2" (exchange2013 in poi)
MONITORAGGIO SPOSTAMENTO
Get-MoveRequest
Get-MoveRequestStatistic
CANCELLAZIONE
Remove-MailboxDatabase "Mailbox Database 1"


P.S.
se prima di cancellare il DB lo tenete smontato per un po potrebbe essere necessario disabilitare l'indicizzazione verso quel DB. Per farlo e sufficiente usare il seguente comando:

Get-MailboxDatabase -identity "mailbox database" -IndexEnable $false

e riavviare il servizio di ricerca di Exchange.



REFERENCE
https://docs.microsoft.com/en-us/exchange/recreating-arbitration-mailboxes-exchange-2013-help
http://techgenix.com/what-are-arbitration-mailboxes-used/
http://www.thatlazyadmin.com/2191-2/



Nessun commento:

Posta un commento