During an in-place Cumulative Update (CU) or Exchange Server Subscription Edition (SE) upgrade on Exchange Server 2016, Exchange Server 2019, or Exchange SE, Setup.exe may abort during the Prerequisite Analysis or Mailbox Role installation step with the following fatal error in ExchangeSetup.log:
Error:
The following error was generated when "$error.Clear();
$feRole = [Microsoft.Exchange.Management.Deployment.RoleManager]::GetRoleByName('FrontendTransportRole');
..." was run: "System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\Temp\ExchangeSetup\bin\EnterpriseServiceEndpointsConfig.xml'."
Even though the error message points to C:\Windows\Temp\ExchangeSetup\bin\EnterpriseServiceEndpointsConfig.xml, creating that file or folder manually in C:\Windows\Temp will not fix the problem. The actual root cause lies in corrupted or missing Exchange Role version strings inside the Windows Registry (HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15).
In this troubleshooting runbook, we explain why Exchange Setup looks in the wrong path when role registry keys are inconsistent, and provide an automated PowerShell audit and repair script to restore the missing registry strings and complete your CU upgrade cleanly.
Planning an Exchange 2019 to Exchange Server SE Upgrade? Check out our complete Exchange Server SE vs. Exchange 2019 In-Place Upgrade Runbook and Installing Exchange Server 2019 & SE on Windows Server Core.
Root Cause: Mismatched or Missing v15 Role Registry Version Strings
When Exchange Server Setup.exe initializes, it queries HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15 to determine which server roles are already installed (AdminTools, ClientAccessRole, FrontendTransportRole, HubTransportRole, MailboxRole, UnifiedMessagingRole) and whether they are being installed fresh or upgraded.
For every installed Exchange role, Setup expects three exact REG_SZ string values to be present and identical:
UnpackedVersion(e.g.,15.1.2507.6for Exchange 2016 CU23 or15.2.1544.4for Exchange 2019 CU14)ConfiguredVersionPostSetupVersion
If a previous CU installation failed mid-way or a server reboot interrupted Setup, one or more of the role subkeys may be missing ConfiguredVersion or PostSetupVersion (or may still contain temporary WaterMark and Action registry values). When ConfiguredVersion is missing on a role key, Exchange Setup mistakenly treats that single role as an unconfigured fresh install instead of an upgrade, causing it to look for EnterpriseServiceEndpointsConfig.xml in C:\Windows\Temp\ExchangeSetup\bin\ instead of %ExchangeInstallPath%\bin\.
Step 1: Audit Your Exchange Role Registry Keys with PowerShell
Before modifying the registry, run the following PowerShell diagnostic snippet in an elevated PowerShell window on the affected Exchange server to inspect the UnpackedVersion, ConfiguredVersion, PostSetupVersion, Action, and WaterMark values across all installed role keys:
# Audit-ExchangeRoleRegistryKeys.ps1
$BaseRegPath = "HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15"
# Export a full backup of the v15 registry key before making any changes
$BackupFile = "C:\Temp\ExchangeV15_RegBackup_$(Get-Date -Format 'yyyyMMdd_HHmmss').reg"
New-Item -Path "C:\Temp" -ItemType Directory -Force | Out-Null
reg.exe export "HKLM\SOFTWARE\Microsoft\ExchangeServer\v15" $BackupFile /y | Out-Null
Write-Host "[+] Registry backup saved to: $BackupFile" -ForegroundColor Cyan
$RoleKeys = @(
"AdminTools",
"ClientAccessRole",
"FrontendTransportRole",
"HubTransportRole",
"MailboxRole",
"UnifiedMessagingRole" # Present on Exchange 2016; absent on Exchange 2019 / Exchange SE
)
$AuditResults = foreach ($Role in $RoleKeys) {
$RolePath = Join-Path $BaseRegPath $Role
if (Test-Path $RolePath) {
$Props = Get-ItemProperty -Path $RolePath -ErrorAction SilentlyContinue
[PSCustomObject]@{
RoleName = $Role
UnpackedVersion = $Props.UnpackedVersion
ConfiguredVersion = $Props.ConfiguredVersion
PostSetupVersion = $Props.PostSetupVersion
StaleWaterMark = $Props.WaterMark
StaleAction = $Props.Action
Status = if ($Props.UnpackedVersion -and ($Props.UnpackedVersion -eq $Props.ConfiguredVersion) -and ($Props.UnpackedVersion -eq $Props.PostSetupVersion)) { "Healthy" } else { "MISMATCH / MISSING" }
}
}
}
$AuditResults | Format-Table -AutoSize
Example Output on a Broken Server:
RoleName UnpackedVersion ConfiguredVersion PostSetupVersion StaleWaterMark Status
-------- --------------- ----------------- ---------------- -------------- ------
AdminTools 15.1.2507.6 15.1.2507.6 15.1.2507.6 Healthy
ClientAccessRole 15.1.2507.6 15.1.2507.6 15.1.2507.6 Healthy
FrontendTransportRole 15.1.2507.6 MISMATCH / MISSING
HubTransportRole 15.1.2507.6 15.1.2507.6 15.1.2507.6 Healthy
MailboxRole 15.1.2507.6 15.1.2507.6 <Watermark...> MISMATCH / MISSING
UnifiedMessagingRole 15.1.2507.6 15.1.2507.6 15.1.2507.6 Healthy
Notice how FrontendTransportRole and MailboxRole are missing ConfiguredVersion and PostSetupVersion!
Step 2: Automated PowerShell Fix (Or Manual Registry Editor Steps)
Option A: Automated PowerShell Remediation Script (Recommended)
Run the script below to automatically populate any missing ConfiguredVersion, UnpackedVersion, or PostSetupVersion strings across all installed Exchange role subkeys using the authoritative version from AdminTools:
# Repair-ExchangeRoleRegistryKeys.ps1
$BaseRegPath = "HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15"
$AdminToolsProps = Get-ItemProperty -Path "$BaseRegPath\AdminTools"
$BaselineVersion = $AdminToolsProps.UnpackedVersion
if (-not $BaselineVersion) {
throw "Could not determine baseline UnpackedVersion from HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\AdminTools"
}
Write-Host "[+] Using authoritative Baseline Version: $BaselineVersion" -ForegroundColor Cyan
$RoleKeys = @(
"AdminTools",
"ClientAccessRole",
"FrontendTransportRole",
"HubTransportRole",
"MailboxRole",
"UnifiedMessagingRole"
)
foreach ($Role in $RoleKeys) {
$RolePath = Join-Path $BaseRegPath $Role
if (Test-Path $RolePath) {
foreach ($ValueName in @("UnpackedVersion", "ConfiguredVersion", "PostSetupVersion")) {
$CurrentVal = (Get-ItemProperty -Path $RolePath -Name $ValueName -ErrorAction SilentlyContinue).$ValueName
if ($CurrentVal -ne $BaselineVersion) {
Set-ItemProperty -Path $RolePath -Name $ValueName -Value $BaselineVersion -Type String
Write-Host "[✔] Restored $Role -> $ValueName = $BaselineVersion" -ForegroundColor Green
}
}
}
}
Write-Host "`n[✔] All Exchange v15 Role version keys are now aligned! Re-run Setup.exe /m:Upgrade." -ForegroundColor Green
Option B: Manual Fix via Registry Editor (regedit.exe)
If you prefer using the Registry Editor GUI:
- Open
regedit.exeas Administrator and navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15
- Inspect each of the installed role subkeys under
v15:
- AdminTools
- ClientAccessRole
- FrontendTransportRole
- HubTransportRole
- MailboxRole
- UnifiedMessagingRole (Exchange 2016 only)
- Verify that every role subkey contains all three String Values (
REG_SZ):
- ConfiguredVersion
- UnpackedVersion
- PostSetupVersion
- If any of those three strings is missing under a role key, right-click in the right pane, select New > String Value, name it (
ConfiguredVersion,UnpackedVersion, orPostSetupVersion), and set its value to match the exact build number shown in the healthy roles (for example,15.1.1713.5or15.2.1544.4).
Step 3: Re-Run the Exchange Server Cumulative Update (Setup.exe /m:Upgrade)
Once all role subkeys under HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15 have matching ConfiguredVersion, UnpackedVersion, and PostSetupVersion values, launch an elevated Command Prompt and run the unattended upgrade from your mounted Exchange CU ISO:
Setup.exe /Mode:Upgrade /IAcceptExchangeServerLicenseTerms_DiagnosticDataON
Setup will now recognize all installed roles properly, resolve EnterpriseServiceEndpointsConfig.xml from %ExchangeInstallPath%\bin\, and complete the Cumulative Update without error.