How uninstall Exchange 2019 on Windows Server Core 2022

满堂花醉三千客,一剑霜寒十四州。这篇文章主要讲述How uninstall Exchange 2019 on Windows Server Core 2022相关的知识,希望能为你提供帮助。
先总结一下:
删除Exchange,主要注意先删除Mailbox  Database上的mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes, Audit mailboxes,Monitoring mailbox
要删除arbitration mailboxes,先要删除默认的Offline Address Books
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;
Get-MailboxDatabase -Status | Sort Name | Format-Table Name, Server, Mounted
Get-Mailbox -Database "ExDB01" | Disable-Mailbox
Get-OfflineAddressBook | Remove-OfflineAddressBook
Get-Mailbox -Database "ExDB01" -Arbitration | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed
Get-Mailbox -Database "ExDB01" -Monitoring | Disable-Mailbox
Get-Mailbox -Database "ExDB01" -AuditLog | Disable-Mailbox
Get-MailboxDatabase| Remove-MailboxDatabase
logoff
d:\\Setup.exe /m:uninstall /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF


1.Uninstall Exchange:
1)d:\\Setup.exe /m:uninstall /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF
Setup cant continue with the uninstall because the powershell (8148) has open files. Close the process, and then
restart Setup.
For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.ProcessNeedsToBeClosedOnUninstall.aspx
Uninstall cant continue. Errors:
This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes, 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. To disable a Audit mailbox  so that you can delete the mailbox database, 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 < Database ID> . It was running the  command
Remove-MailboxDatabase CN=ExDB01,CN=Databases,CN=Exchange Administrative Group(FYDIBOHF23SPDLT),CN=Administrative Groups,CN=afd,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=ykx,DC=ai -whatif.
For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.UnwillingToRemoveMailboxDatabase.aspx
The Exchange Server setup operation didnt complete. More details can be found in ExchangeSetup.log located in the
< SystemDrive> :\\ExchangeSetupLogs folder.


2)Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;
Get-MailboxDatabase -Status | Sort Name | Format-Table Name, Server, Mounted

3)Get-Mailbox -Database "ExDB01"

4)Get-MailboxPlan
Get-Mailbox -Database "ExDB01" -Archive
Get-Mailbox -Database "ExDB01" -PublicFolder
5)Get-Mailbox -Database "ExDB01" -Arbitration

6)Get-Mailbox -AuditLog

7)Get-Mailbox -Database "ExDB01" -Monitoring

8) Get-Mailbox -Database "ExDB01" | Disable-Mailbox

9) Get-Mailbox -Database "ExDB01" -Arbitration | Disable-Mailbox -Arbitration

Confirm
Are you sure you want to perform this action?
Disabling mailbox "ykx.ai/Users/SystemMailbox1f05a927-9924-43d9-a124-a9385c071733" will remove the Exchange
properties from the Active Directory user object and mark the mailbox in the database for removal. If the mailbox has
an archive or remote archive, the archive will also be marked for removal. In the case of remote archives, this action
is permanent. You cant reconnect this user to the remote archive again.
[Y] Yes   [A] Yes to All   [N] No   [L] No to All   [S] Suspend   [?] Help (default is "Y"): a
Disable-Mailbox : Exchange cant disable the mailbox "ykx.ai/Users/SystemMailboxbb558c35-97f1-4cb9-8ff7-d53741dc928c"
because one or more Offline Address Books are assigned to it for generation.   Please remove or re-assign those Offline
Address Books before disabling this mailbox.
At line:1 char:47
+ ... ailbox -Database "ExDB01" -Arbitration | Disable-Mailbox -Arbitration
+                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo           : NotSpecified: (ykx.ai/Users/Sy...7-d53741dc928c:ADObjectId) [Disable-Mailbox], Recipien
  tTaskException
    + FullyQualifiedErrorId : [Server=EX01,RequestId=c5f884c7-f319-4583-800d-0a9c00e6d124,TimeStamp=2022/1/30 6:48:53]
    [FailureCategory=Cmdlet-RecipientTaskException] 4A93D1AE,Microsoft.Exchange.Management.RecipientTasks.DisableMail   box
10)Get-OfflineAddressBook | Remove-OfflineAddressBook

  Get-Mailbox -Database "ExDB01" -Arbitration | Disable-Mailbox -Arbitration
Disable-Mailbox : Exchange cant disable the arbitration mailbox "ykx.ai/Users/SystemMailboxbb558c35-97f1-4cb9-8ff7-d5
3741dc928c" because its the last one in the organization.
At line:1 char:47
+ ... ailbox -Database "ExDB01" -Arbitration | Disable-Mailbox -Arbitration
+                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo           : NotSpecified: (ykx.ai/Users/Sy...7-d53741dc928c:ADObjectId) [Disable-Mailbox], Recipien
  tTaskException
    + FullyQualifiedErrorId : [Server=EX01,RequestId=5c41d370-66f4-47b6-b62a-d2564a0e9627,TimeStamp=2022/1/30 6:53:18]
    [FailureCategory=Cmdlet-RecipientTaskException] 5F539392,Microsoft.Exchange.Management.RecipientTasks.DisableMail   box

11)Get-Mailbox -Database "ExDB01" -Arbitration | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed
12)  Get-Mailbox -Database "ExDB01" -Monitoring | Disable-Mailbox

13)Get-Mailbox -Database "ExDB01" -AuditLog | Disable-Mailbox

14)Get-MailboxDatabase| Remove-MailboxDatabase

15)d:\\Setup.exe /m:uninstall /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF

16)logoff 
17)重新登陆并重新运行:
d:\\Setup.exe /m:uninstall /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF

18)将Exchange相关信息从AD中删除:
a)打开ADSI Edit:

b)打开Active Directory Users and Computers 删除相关的用户:



【How uninstall Exchange 2019 on Windows Server Core 2022】


    推荐阅读