Aslında çok güncel bir konu değil, hatta baktığımda Türkçe bile kaynak çok, çünkü Exchange Server Dünya da olduğu gibi ülkemizde de uzun yıllardır yaygın kullanılıyor. Bu nedenle de özellikle sürüm yükseltme geçiş süreçlerindeki adımlardan birisi posta kutusu taşımak ve işlemler bittikten sonra eski sunucuyu kaldırmaktır. Eski sunucuyu kaldırmak için ise bir kaç temel kontrol noktası vardır. Bunların en temeli eski posta kutusu veri tabanlarını silmektir. Ancak arayüzde göremiyor olmanıza rağmen aşağıdaki gibi bir hata alabilirsiniz;
Hata ise tam aşağıdaki gibidir;
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 Database ID. 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 Database ID -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database Database ID -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database Database ID -Arbitration.
To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox Mailbox ID. To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox Mailbox ID -Archive. To disable a public folder mailbox so that you can delete the mailbox database, run the command Disable-Mailbox Mailbox ID -PublicFolder. Arbitration mailboxes should be moved to another server; to do this, run the command New-MoveRequest Parameters. If this is the last server in the organization, run the command Disable-Mailbox Mailbox ID -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration mailbox. Mailbox plans should be moved to another server; to do this, run the command Set-MailboxPlan MailboxPlan ID -Database Database ID.
+ CategoryInfo : InvalidOperation: (Database ID :DatabaseIdParameter) [Remove-MailboxDatabase], AssociatedUserMailboxExistException
+ FullyQualifiedErrorId : [Server= Server,RequestId= RequestId,TimeStamp= TimeStamp ] [FailureCategory=Cmdlet-AssociatedUserMailboxExistException] XXXXXXXX,Microsoft.Exchange.Management.SystemConfigurationTasks.RemoveMailboxDatabase
+ PSComputerName : Computer Name
veya
This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes arbitration mailboxes, or audit mailboxes. To get a list of all mailboxes in this database, run the command Get-Mailbox -Database <Database ID>. 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 <Database ID> -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -Arbitration. To get a list of all Audit mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -AuditLog. To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID>. To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID> -Archive. To disable a public folder mailbox so that you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID> -PublicFolder. Audit mailboxes should be moved to another server; to do this, run the command New-MoveRequest <parameters>. If this is the last server in the organization, run the command Get-Mailbox -AuditLog | Disable-Mailbox. Arbitration mailboxes should be moved to another server; to do this, run the command New-MoveRequest <parameters>. If this is the last server in the organization, run the command Disable-Mailbox <Mailbox ID> -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration mailbox. Mailbox plans should be moved to another server; to do this, run the command Set-MailboxPlan <MailboxPlan ID> -Database
Peki neden böyle bir hata alıyoruz? Aslında cevabı çok basit; bu veri tabanı ile ilişkili bir taşıma işi, ya da hala göremediğimiz bir sistem posta kutusu veya yukarıdaki uyarıda olduğu gibi mailboxplan (sadece online için geçerlidir) vb durumlar söz konusu olabilir. Bizimde görevimiz aslında bunu bulmak. Öncelikle kolay yoldan başlayabiliriz ve ilgili veri tabanı için aşağıdaki komutları sırası ile çalıştırıp unuttuğumuz bir posta kutusu olup olmadığını kontrol edebiliriz;
Get-Mailbox -Database “Database-Name”
Get-Mailbox -Database “Database-Name” -Auditlog
Get-Mailbox -Database “Database-Name” -Monitoring
Get-Mailbox -Database “Database-Name” -Arbitration
Get-Mailbox -Database “Database-Name” -Archive
Get-Mailbox -Database “Database-Name” -PublicFolder
Get-Mailbox -Database “Database-Name” -Archive
Eğer bunlardan bir sonuç alamazsanız aşağıdaki komutu deneyin.
Get-Mailbox | where {$_.ArchiveDatabase -eq “”}
Peki sonuç çıkar ise ne yapacağız.
İlgili komutun devamında hemen bir taşıma isteği oluşturacağız, örnek aşağıdaki gibidir;
Get-Mailbox DiscoverySearchMailbox* | New-MoveRequest -TargetDatabase “YeniSunucuDBismi”
Eğer hiç bir posta kutusu yok ise bir taşıma işi olabilir. Aşağıdaki komut ile bunu kontrol edebiliriz.
Get-MoveRequestStatistics -MoveRequestQueue “Database-Name”
Peki move isteği var ise ne yapıyoruz, yine aynı şekilde sonuna silme isteği oluşturuyoruz.
Get-MoveRequest -ResultSize Unlimited | Where-Object {$_.Status -like “Completed”} | Remove-MoveRequest -Confirm:$false
Yukarıdaki komut organizasyondaki tüm tamamlanmış taşıma işlerini siler, sadece ilgili veri tabanına ait işleri silmek için aşağıdaki komutu kullanabilirsiniz.
Get-MoveRequestStatistics -MoveRequestQueue “Database-Name” | Remove-MoveRequest -Confirm:$false
Tüm bunlara rağmen eğer ilgili veri tabanı silinmiyor ve hiç bir bağlantı olmadığına emin iseniz (ama mutlaka vardır, buna emi olun, bu makaleyi kaleme alırken 25 yıldır bu işi yapıyorum, forularda aynı konuda tüm komutları denememe rağmen olmadı diyenler çok insan gördüm ama mutlaka unuttuğunuz, atladığınız bir şey vardır) bu durumda ADSIEDIT aracı ile aşağıdaki gibi DB yi bulup silebilirsiniz. Ama mutlaka öncesinde yedek alın.
Umarım faydalı olmuştur.