Troubleshooting Exchange Server CU & SE Setup Failures: Analyzing ExchangeSetup.log and Clearing Registry Watermarks

Nothing causes more anxiety during an Exchange maintenance window than a Cumulative Update (CU) or Exchange Server Subscription Edition (SE) installation failing halfway through the Mailbox Role configuration.

When Exchange Setup encounters a fatal exception, the server is left in an inconsistent "Incomplete Installation" state. Management tools may fail to open, services refuse to start, and subsequent attempts to run Setup abort with an error stating that a previous installation was interrupted.

This guide provides an end-to-end recovery methodology: analyzing ExchangeSetup.log, resolving the underlying Active Directory / Discovery Management failure, clearing or repairing the registry Watermark, and completing the upgrade successfully.


Exchange Setup Failure Analysis & Watermark Recovery Lifecycle Phase 1: Setup Aborts Fatal error at Mailbox Role E.g., Discovery Management trust Installation halts abruptly Server left in incomplete state Phase 2: Log Analysis Triage ExchangeSetup.log Search: [ERROR] & [FATAL] Identify failed task & parameter Isolate AD / Permissions root cause Phase 3: Watermark Check Inspect Registry v15/v16 HKLM:\SOFTWARE\Microsoft\... Examine Action & Watermark keys Clear or prepare for resume Phase 4: Remediate Root Cause & Resume Setup 1. Remediate failed dependency (Discovery mailbox / AD permissions) 2. Run Setup.exe /m:Upgrade /IAcceptExchangeServerLicenseTerms_DiagnosticDataON 3. Verify all Exchange services return to Running state

1. Locating and Parsing ExchangeSetup.log

Whenever Exchange Setup fails, the error displayed on the GUI screen is often truncated. The definitive diagnostic detail is recorded in:

  • C:\ExchangeSetupLogs\ExchangeSetup.log
  • C:\ExchangeSetupLogs\ExchangeSetup.msilog

Rapid PowerShell Log Extraction

Run this PowerShell command to extract the exact error block and call stack without opening a 100 MB text file in Notepad:

POWERSHELL
$logPath = "C:\ExchangeSetupLogs\ExchangeSetup.log"

if (Test-Path $logPath) {
    Write-Host "Extracting latest error blocks from $logPath..." -ForegroundColor Cyan
    Get-Content $logPath | Select-String -Pattern "\[ERROR\]" -Context 2, 8 |
        Select-Object -Last 3 | ForEach-Object {
            Write-Host "--------------------------------------------------" -ForegroundColor Yellow
            $_.Context.PreContext
            Write-Host $_.Line -ForegroundColor Red
            $_.Context.PostContext
        }
} else {
    Write-Warning "ExchangeSetup.log not found at default location."
}

2. Analyzing the Discovery Management Failure

A frequent error during the Mailbox Services installation phase is:

TEXT
[ERROR] Couldn't resolve the user or group "xyz.com/Microsoft Exchange Security Groups/Discovery Management."
If the user or group is a foreign forest principal, you must have either a two-way trust or an outgoing trust.
[ERROR] The trust relationship between the primary domain and the trusted domain failed.

Why Does This Happen?

During role configuration, the setup script Setup-DiscoveryMailbox.ps1 runs internally:

POWERSHELL
$dmRoleGroupGuid = [Microsoft.Exchange.Data.Directory.Management.RoleGroup]::DiscoveryManagementWkGuid;
$dmRoleGroup = Get-RoleGroup -Identity $dmRoleGroupGuid -DomainController $RoleDomainController;
Add-MailboxPermission $dismbx -User $dmRoleGroup.Identity -AccessRights FullAccess;

If your Active Directory forest has:

  1. Stale cross-forest trusts with orphaned SID references in security descriptors.
  2. A multi-domain tree where the domain controller contacted by Setup cannot resolve the group from the root domain.
  3. An orphaned or corrupted DiscoverySearchMailbox user account.

The Add-MailboxPermission call throws an unhandled exception, halting the installation.


3. The Registry Watermark: Understanding Setup State

When Setup begins installing a role, it stamps a Watermark in the Windows Registry under:

TEXT
HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\MailboxRole
(or v16 for Exchange Server SE / 2019)

Within this key, three critical values dictate whether Setup will allow you to resume:

  • Action: Set to Install or Upgrade.
  • Watermark: Set to a hexadecimal value or timestamp indicating that installation is incomplete.
  • UnpackedVersion: The build number currently being applied.

If you attempt to re-run Setup without addressing the failure, Setup checks these keys, sees that Watermark exists, and reports:

"The previous installation of this role did not complete successfully. Setup cannot continue."

Inspecting the Registry Watermark via PowerShell

POWERSHELL
$regPath = "HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\MailboxRole"
if (Test-Path $regPath) {
    Get-ItemProperty -Path $regPath | Select-Object Action, Watermark, UnpackedVersion, ConfiguredVersion
}
CAUTION:
Do NOT blindly delete the entire MailboxRole registry key! Deleting the key can corrupt the server's identity and cause Setup to believe the server has never had the Mailbox role installed, potentially overwriting existing configuration and database metadata.

4. Step-by-Step Recovery Procedure

Step 1: Mitigate the Discovery Search Mailbox Block

Execute the temporary bypass so Setup can proceed past the permission stamping phase:

POWERSHELL
# Open Exchange Management Shell (or load Exchange snapin)
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn -ErrorAction SilentlyContinue

# Disable the Discovery mailbox
Disable-Mailbox -Identity "DiscoverySearchMailbox {D919BA05-46A6-415f-80AD-7E09334BB852}" -Confirm:$false

Step 2: Clear the Incomplete Watermark

If Setup refuses to resume, clear the Watermark value while preserving the Action and version markers:

POWERSHELL
$roleKeys = @(
    "HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\MailboxRole",
    "HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\ClientAccessRole",
    "HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\HubTransportRole"
)

foreach ($key in $roleKeys) {
    if (Test-Path $key) {
        $props = Get-ItemProperty -Path $key -ErrorAction SilentlyContinue
        if ($props.Watermark) {
            Write-Host "Clearing Watermark on $key..." -ForegroundColor Yellow
            Remove-ItemProperty -Path $key -Name "Watermark" -Force
        }
    }
}

Step 3: Resume Exchange Setup from Command Line

Always resume Setup using the command line rather than the GUI. This gives you immediate real-time output and avoids GUI wizard timeouts:

CMD
Setup.exe /m:Upgrade /IAcceptExchangeServerLicenseTerms_DiagnosticDataON

Setup will detect the existing files, verify prerequisites, and proceed directly to completing the remaining tasks for the Mailbox Role.

Step 4: Re-Enable and Re-Stamp Discovery Permissions

Once Setup finishes with The Microsoft Exchange Server setup operation completed successfully:

POWERSHELL
# 1. Re-enable the Discovery Search Mailbox
Enable-Mailbox -Identity "DiscoverySearchMailbox {D919BA05-46A6-415f-80AD-7E09334BB852}" -Discovery

# 2. Add FullAccess permissions back for Discovery Management
Add-MailboxPermission -Identity "DiscoverySearchMailbox {D919BA05-46A6-415f-80AD-7E09334BB852}" `
    -User "Discovery Management" `
    -AccessRights FullAccess

5. Post-Upgrade Health Verification

After completing the upgrade, ensure that all core Exchange services are running and that the server can accept mail flow:

POWERSHELL
# Verify Exchange Services
Get-Service | Where-Object { $_.Name -like "MSExchange*" -and $_.StartType -eq "Automatic" } |
    Select-Object Name, Status, StartType

# Verify Server Component States
Get-ServerComponentState -Identity $env:COMPUTERNAME |
    Where-Object { $_.State -ne "Active" } |
    Format-Table Component, State, Requester -AutoSize

# Check Mailbox Database Copy Status
Get-MailboxDatabaseCopyStatus -Server $env:COMPUTERNAME

If any component state remains Inactive or Draining, recover it using:

POWERSHELL
Set-ServerComponentState -Identity $env:COMPUTERNAME -Component ServerWideOffline -State Active -Requester Maintenance

💬 Reader Comments & Feedback

Did this runbook help, or did Microsoft change a cmdlet or UI menu? Share your feedback below.