Installing Exchange Server SE & 2019 via Command Line: Unattended Step-by-Step Installation Runbook

While the graphical Setup wizard is convenient for single-server lab evaluations, enterprise production deployments of Exchange Server Subscription Edition (SE) and Exchange Server 2019 require scripted, unattended command-line installations.

Command-line installations (Setup.exe /Mode:Install) prevent GUI timeout freezes, allow automated logging to remote management consoles, support automated infrastructure pipelines (PowerShell DSC, Ansible, Terraform), and enforce standardized disk partitioning and prerequisite checks.

This engineering runbook walks you through the entire command-line deployment lifecycle for modern Exchange Server: from Windows Server 2022 / 2025 prerequisite provisioning and Active Directory schema preparation to unattended execution and post-install health verification.


Exchange Server SE & 2019 Unattended CLI Installation Pipeline 1. OS & Dependencies Windows Server Features Install-WindowsFeature RSAT, IIS, RPC Visual C++ Runtimes 2013 & 2015-2022 x64 Redistributable IIS URL Rewrite & UCMA URL Rewrite 2.1 & UCMA 4.0 runtime Pagefile & Disks Fixed Pagefile: RAM + 10MB (max 32GB) 2. Active Directory Prep Schema Master Extension Setup.exe /PrepareSchema Organization Configuration Setup.exe /PrepareAD /OrganizationName Domain Preparation Setup.exe /PrepareAllDomains License Agreement Switch /IAcceptExchangeServerLicenseTerms_... 3. Unattended Install Mailbox Role Execution /m:Install /roles:m /TargetDir Extended Protection (EPA) Enabled by default in modern setup Post-Install Verification Test-ServiceHealth & ComponentState Security Patching Apply latest monthly Security Update (SU) Supported on Windows Server 2025 and Windows Server 2022 (Desktop Experience & Core)

1. Operating System & Software Prerequisites

Before launching Setup.exe, run the following PowerShell commands from an elevated terminal on your target Windows Server 2022 / 2025 host:

Step 1: Install Required Windows Features

POWERSHELL
Install-WindowsFeature RSAT-ADDS, Server-Media-Foundation, NET-Framework-45-Features, `
    RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, `
    RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, Web-Mgmt-Console, `
    WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, `
    Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, `
    Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, `
    Web-ISAPI-Filter, Web-Metabase, Web-Net-Ext45, Web-Request-Monitor, `
    Web-Static-Content, Web-Windows-Auth, Web-WMI -Restart:$false

Step 2: Download & Install Runtime Packages

  1. Visual C++ 2013 Redistributable Package (x64)
  2. Visual C++ 2015–2022 Redistributable Package (x64)
  3. IIS URL Rewrite Module 2.1 (x64)
  4. Unified Communications Managed API 4.0 Runtime (UCMA 4.0)

2. Active Directory Preparation via CLI

If this is the first Exchange Server SE / 2019 server in your Active Directory forest, prepare the directory schema and configuration partition from a server located in the same Active Directory site as the Schema Master:

CMD
:: 1. Extend the Active Directory Schema
Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON /PrepareSchema

:: 2. Prepare the Active Directory Organization
:: (Only specify /OrganizationName if this is a brand new Exchange deployment)
Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON /PrepareAD /OrganizationName:"Contoso Corp"

:: 3. Prepare All Domains hosting users or Exchange resources
Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON /PrepareAllDomains
IMPORTANT:
Since Exchange 2019 CU12 and Exchange Server SE, Microsoft requires explicitly accepting telemetry diagnostics via either:
- /IAcceptExchangeServerLicenseTerms_DiagnosticDataON (Recommended)
- /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF
> Using the legacy /IAcceptExchangeServerLicenseTerms parameter alone will throw an error and abort setup.

3. Command-Line Installation Syntax

In modern Exchange (Exchange 2016, 2019, and Exchange SE), Microsoft consolidated the architectural roles into two options:

  • Mailbox Role (/roles:m): Combines Mailbox services, Client Access front-end, Hub Transport, and Unified Messaging routing.
  • Edge Transport Role (/roles:e): Perimeter anti-spam and mail hygiene proxy.

Standard Unattended Mailbox Role Installation

Run this command from an elevated Command Prompt or PowerShell (mounted to the Exchange ISO drive, e.g., E:\):

CMD
Setup.exe /Mode:Install /Roles:Mailbox /TargetDir:"D:\Program Files\Microsoft\Exchange Server\V15" /InstallWindowsComponents /IAcceptExchangeServerLicenseTerms_DiagnosticDataON

Explanation of Parameters:

SwitchParameter OptionsDescription
/Mode: or /m:Install, Upgrade, Uninstall, RecoverServerSpecifies the operation. Use Install for fresh server builds and Upgrade for cumulative updates.
/Roles: or /r:Mailbox (or m), EdgeTransport (or e), ManagementTools (or mt)In Exchange SE and 2019, ca, hub, and um switches are obsolete. Use m for all Mailbox services.
/TargetDir:Absolute path stringSpecifies custom installation drive (e.g., fast dedicated SSD/NVMe volume).
/InstallWindowsComponentsSwitchAutomatically installs any missing Windows Server operating system roles or features.
/IAcceptExchangeServerLicenseTerms_DiagnosticDataONSwitchAccepts license terms and enables diagnostic telemetry reporting.

4. Post-Installation Verification & Health Check

Once Setup finishes with The Microsoft Exchange Server setup operation completed successfully, reboot the server and run this post-installation PowerShell audit:

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

# 2. Check Server Component State
Get-ServerComponentState -Identity $env:COMPUTERNAME |
    Format-Table Component, State, Requester -AutoSize

# 3. Test Core Exchange Health
Test-ServiceHealth
Test-SystemHealth

# 4. Verify Extended Protection (EPA) on Virtual Directories
$vdirs = @("Autodiscover", "EWS", "OWA", "ECP", "OAB", "Microsoft-Server-ActiveSync", "PowerShell", "RPC")
foreach ($vdir in $vdirs) {
    $epa = Get-WebConfigurationProperty -PSPath "IIS:\Sites\Default Web Site\$vdir" `
        -Filter "system.webServer/security/authentication/windowsAuthentication/extendedProtection" `
        -Name "tokenChecking" -ErrorAction SilentlyContinue
    [PSCustomObject]@{
        VirtualDirectory = $vdir
        ExtendedProtection = $epa.Value
    }
}

5. Security Patching: Applying the Latest Security Update (SU)

A clean installation from the RTM ISO does not include the latest monthly security fixes. Never put a newly installed Exchange Server into production before applying the latest Security Update.

  1. Download the latest cumulative security update (e.g., KB5133453).
  2. Open an elevated command prompt (Run as administrator).
  3. Execute the MSP patch:
CMD
   msiexec.exe /p Exchange2019-KB5133453-x64-en.msp /qn /l*v "C:\ExchangeSetupLogs\KB5133453_Install.log"
   
  1. Reboot the server and confirm all DAG replication endpoints, virtual directories, and transport queues are online.

💬 Reader Comments & Feedback

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