Pre-Upgrade Prerequisites Check for Exchange Server SE
A comprehensive PowerShell script that audits 13 critical areas before you upgrade from Exchange 2019 to Exchange Server SE — so nothing breaks on production day.
Why You Need This Script
Upgrading a production Exchange environment to Exchange Server SE (Subscription Edition) is one of the most consequential infrastructure operations a messaging team can perform. Unlike routine cumulative updates, this is a platform-level migration — and the blast radius of a failed upgrade can include mailbox downtime, broken hybrid connectivity, certificate mismatches, and DAG failover cascades.
Microsoft’s official documentation lists the prerequisites, but checking each item manually across multiple servers is error-prone and time-consuming. This script automates that entire checklist, runs it in minutes, and produces a colour-coded console report plus a timestamped text file you can attach to your change record.
Run on every Exchange server individually. Each node in your DAG may have different .NET versions, certificate states, or service configurations. A single-pass check on one server is not sufficient for multi-node deployments.
What the Script Checks — All 13 Sections
The script is structured into clearly named sections. Each check emits one of four statuses:
PASS Requirement met — safe to proceed
WARN Non-blocking issue — review before upgrade
FAIL Blocking issue — must be resolved first
INFO Informational — recorded for your change record
Exchange Management Shell
Validates that EMS is loaded and Exchange cmdlets are available. Script exits immediately if this fails.
Operating System
Checks Windows Server build number. Exchange SE requires WS2022 or WS2025 — WS2019 is rejected. Also detects pending reboots.
Hardware — CPU & Disk
Validates logical CPU count (min 4), RAM (64 GB min / 128 GB recommended), and free space on all drives.
Software Prerequisites
.NET Framework version (4.8+ required), Visual C++ 2012 Redistributable, and all required Windows Server roles/features.
Exchange Version & Services
Validates CU15 build (15.2.1748+), Exchange service health, and server component state / maintenance mode detection.
DAG Health
Checks all DAG members are operational, all database copies are Healthy, and copy/replay queue lengths are within limits.
Certificates
Reports days-to-expiry for all Exchange certificates and performs a dedicated check on the OAuth certificate used for hybrid.
Active Directory
Forest and domain functional levels, Exchange AD schema version (rangeUpper), and AD replication health via repadmin.
Hybrid Configuration
Hybrid config object, send/receive connectors, live OAuth connectivity test to Exchange Online, and federation trusts.
Mail Flow & Transport
Checks queue depth on all queues and runs Test-Mailflow to confirm internal mail routing is healthy.
Windows Updates
Lists the 15 most recent hotfixes and warns if no patches have been applied in the last 90 days.
Virtual Directories
Documents all internal and external URLs (OWA, EWS, ECP, ActiveSync) for your change record and post-upgrade verification.
Backup Status
Checks LastFullBackup date on every mailbox database. Fails if any database has never been backed up.
Requirements Before Running
| Requirement | Detail |
|---|---|
| Shell | Exchange Management Shell (EMS) — not regular PowerShell |
| Privilege | Run as Administrator (#Requires -RunAsAdministrator enforced) |
| Source server | Run locally on each Exchange 2019 server you plan to upgrade |
| AD module | RSAT-ADDS must be installed for Section 8 AD checks |
| Output folder | Auto-created at C:\ExchangeSE-PreCheck\ (override with -OutputPath) |
| Network | Outbound to outlook.office365.com for the OAuth test (Section 9) |
How to Use the Script
-
Download and save the script
Save as
ExchangeSE-PreCheck.ps1on the local disk of the Exchange server you want to check (e.g.C:\Scripts\). -
Open Exchange Management Shell as Administrator
Right-click the EMS shortcut → Run as Administrator. A regular PowerShell window will not have the Exchange cmdlets available.
-
Set execution policy if needed
If you hit a policy error:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -
Run the script
Navigate to the folder and execute using one of the syntax examples below.
-
Review and remediate
Address every FAIL item before starting the upgrade. Review WARN items and make a documented decision for each.
-
Repeat on all DAG members
Each Exchange server in the DAG must be checked independently. Infrastructure differences between nodes are common.
Script Syntax Examples
# Standard run — checks everything including Hybrid and AD .\ExchangeSE-PreCheck.ps1 # Skip the Hybrid section (non-hybrid environments) .\ExchangeSE-PreCheck.ps1 -SkipHybridCheck # Skip the AD section (run from a server without RSAT-ADDS) .\ExchangeSE-PreCheck.ps1 -SkipADCheck # Save the report to a custom folder .\ExchangeSE-PreCheck.ps1 -OutputPath "D:\Upgrade-Reports" # Combine switches .\ExchangeSE-PreCheck.ps1 -SkipHybridCheck -OutputPath "D:\Reports"
Sample Console Output
Deep Dive — The Checks That Matter Most
OS Compatibility: Windows Server 2019 is a Hard Block
Exchange Server SE does not support Windows Server 2019. The script uses the OS build number — not the marketing name — to detect this. Build 17763 triggers a FAIL and instructs you to upgrade the OS first. Builds 20348 (WS2022) and 26100 (WS2025) pass.
You cannot in-place upgrade the OS while Exchange is installed. The correct sequence is: upgrade Exchange to CU15 on WS2019 → migrate mailboxes to new WS2022/WS2025 servers → decommission WS2019 nodes → upgrade to Exchange SE on WS2022/WS2025.
Exchange Build: CU15 Is the Mandatory Baseline
Exchange Server SE’s installer requires Exchange 2019 CU15 (build 15.2.1748.x) as the minimum version. The script parses ExSetup.exe‘s file version directly, so it’s reliable even when Get-ExchangeServer shows a display version that doesn’t map cleanly. CU14 or earlier triggers a hard FAIL.
DAG Copy Queue — The Upgrade Timing Indicator
High copy or replay queue lengths at upgrade time are a leading cause of data-loss incidents. The script flags queues above 10 as WARN. Best practice is to wait for zero queues on all passive copies before starting any upgrade activity on a DAG member.
Certificate Expiry — The Silent Killer
The upgrade process itself takes time, and if a certificate expires mid-upgrade, client connectivity and hybrid mail flow will break instantly. The script checks every certificate for expiry and pays special attention to the OAuth certificate used by hybrid configurations — which is easy to overlook because it doesn’t appear in normal certificate management workflows.
The OAuth certificate check runs Get-AuthConfig to retrieve the active thumbprint, then validates its expiry independently. If it expires within 30 days, the result is a FAIL — not a warning — because hybrid will break if you upgrade with an expired OAuth cert.
Backup Check — Non-Negotiable
The script reads LastFullBackup from each mailbox database object. Any database that has never been backed up is an immediate FAIL. Databases backed up more than 7 days ago are a WARN. The recommended posture is a successful full backup within 24 hours of upgrade start.
Script Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
-SkipHybridCheck |
Switch | Not set | Skips Section 9 — useful for non-hybrid on-premises-only deployments |
-SkipADCheck |
Switch | Not set | Skips Section 8 — use when RSAT-ADDS is not installed on the Exchange server |
-OutputPath |
String | C:\ExchangeSE-PreCheck |
Directory where the timestamped report text file is saved. Created automatically if missing. |
The Full Script
Copy the script below in its entirety, save it as ExchangeSE-PreCheck.ps1, and run it from Exchange Management Shell as described above.
#Requires -RunAsAdministrator
<#
.SYNOPSIS
Exchange Server SE - Pre-Upgrade Prerequisites Check Script v1.1
.DESCRIPTION
Performs comprehensive pre-upgrade checks for Exchange 2019 to Exchange Server SE migration.
Covers OS, Exchange build, .NET, DAG health, DB copies, certificates, hybrid, AD schema,
disk space, services, hardware, and Windows features.
.NOTES
- Run from Exchange Management Shell (EMS) as Administrator
- Run on EACH Exchange server individually
- Designed for Exchange 2019 DAG + Hybrid environments
- Results exported to C:\ExchangeSE-PreCheck\ folder
.EXAMPLE
.\ExchangeSE-PreCheck.ps1
.\ExchangeSE-PreCheck.ps1 -SkipHybridCheck
.\ExchangeSE-PreCheck.ps1 -OutputPath "D:\Reports"
#>
param(
[switch]$SkipHybridCheck,
[switch]$SkipADCheck,
[string]$OutputPath = "C:\ExchangeSE-PreCheck"
)
#region INITIALIZATION
$ScriptVersion = "1.1"
$ServerName = $env:COMPUTERNAME
$RunTime = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$ReportFileName = "ExchangeSE-PreCheck_${ServerName}_$(Get-Date -Format 'yyyyMMdd_HHmmss').txt"
$ReportFile = Join-Path $OutputPath $ReportFileName
if (-not (Test-Path $OutputPath)) {
New-Item -ItemType Directory -Path $OutputPath -Force | Out-Null
}
$Global:PassCount = 0
$Global:WarnCount = 0
$Global:FailCount = 0
$Global:Results = @()
#endregion
# ... (full script content — see download below)
# Paste the complete script here when deploying to your website.
The script is entirely self-contained. No external modules, no internet connectivity required (except for the optional OAuth test in Section 9), and no registry keys are modified. It is read-only — it collects information only and makes no changes to your environment.
Recommended Pre-Upgrade Workflow
-
Ensure Exchange 2019 CU15 is installed on all servers
This is a hard prerequisite. Exchange SE’s setup will refuse to continue if any server is below CU15.
-
Upgrade OS to Windows Server 2022 or 2025
Build new servers with WS2022/WS2025, join them to the DAG, and migrate databases — or perform an in-place OS upgrade after removing the Exchange server from the DAG.
-
Run this script on every Exchange server
Resolve all FAIL items. Document your response to each WARN item in your change record.
-
Take a full backup of every mailbox database
Confirm backup completion and verify restore point validity before starting any upgrade activity.
-
Run Exchange SE setup with /PrepareSchema then /PrepareAD
Do this from a server with Schema Admin rights before upgrading any Exchange server.
-
Upgrade Exchange servers one DAG member at a time
Move all active databases off the target server, verify DAG health, then run Exchange SE setup. Never upgrade multiple DAG members simultaneously.
-
Re-run the Hybrid Configuration Wizard (HCW)
After all servers are upgraded, run HCW to refresh hybrid settings. Do not skip this step — configuration drift during the upgrade will cause hybrid mail flow issues if not corrected.
Frequently Asked Questions
Can I run this script on Exchange 2016?
The script is designed and tested for Exchange 2019. Some cmdlets and build number logic are Exchange-2019 specific. The CU level detection in Section 5 will give inaccurate results on Exchange 2016 build numbers. For Exchange 2016 environments, the script would need adaptation.
The VC++ check via WMI takes a long time. Is this normal?
Yes. Get-WmiObject Win32_Product is notoriously slow because it triggers a Windows Installer consistency check on every installed product. On servers with many installed applications this can take 2–5 minutes. This is a WMI limitation, not a script bug. You can safely wait for it to complete.
The OAuth test failed but hybrid seems to be working. Should I be worried?
Yes. Test-OAuthConnectivity tests the current token acquisition path. If it fails, hybrid features that rely on OAuth (such as free/busy lookups in certain configurations, mailbox migrations via MRS, and modern hybrid auth) may fail intermittently or break after the upgrade forces a reconfiguration. Investigate and fix OAuth before proceeding.
Can I schedule this script to run automatically?
The script is designed for interactive runs, but nothing prevents scheduling it via Task Scheduler with a service account that has Exchange Organization Admin and Schema Admin rights. Redirect output to a file and review the report. Useful for running weekly health checks in the weeks leading up to your upgrade window.
The report file — where is it saved?
By default in C:\ExchangeSE-PreCheck\. The filename includes the server name and a timestamp in the format ExchangeSE-PreCheck_SERVERNAME_YYYYMMDD_HHmmss.txt, so running the script multiple times does not overwrite previous reports.
Ready to Start Your Pre-Upgrade Audit?
Download the full script, save it to each Exchange server, and run it from Exchange Management Shell. The whole check takes under five minutes per server.
↓ Get the Script AboveDiscover more from ComputerCarriage
Subscribe to get the latest posts sent to your email.

Leave a Reply