Installing Exchange 2019 on Server 2019 for Lab
Right off the bat, if you are looking for resources on how to set up or manange exchange in a production environment then stop reading, this installation was purely for a lab environment to practice red team techniques and play with some recent exploits.
As someone with 0 training in windows adminstration, getting exchange working in my lab has been a long and painful experience. It ended up just taking a lot of research to find a web site with a walk through that finally worked for me to get a basic setup. I will admit that I dont fully understand exactly what every command is completing in the setup process, but its not really necessary for the my use cases. This 5 part guide from nucleus technologies is what I followed for the most part and has much more detail, but I will add some additional links for dependencies to get everything in one place.
NOTE: I am running everything under the domain admin account on my server here for the install process.
Pre-Installation
Environment
Before installing exchange you will need an active directory forest set up with at least one writeable DC. The Forest and Domain must be in 2K12 mode or higher and the DC must be 2K12 or newer. I also am only testing with IPv4 so didnt really need to worry about IPv6 at all. If you already have this type of environment, you can start installing the pre-requisites.
Pre-Requisites
We need to first install .NET Framework, the Visual C++ Redistributable runtime and the Unified communications runtime, then reboot the box. More detailed info can be found here.
After we install the above and reboot, we need to install the following packages using the following powershell commands.
Install-WindowsFeature RSAT-ADDS
Install-WindowsFeature 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-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation, RSAT-ADDS
Schema
Next we need to prep the AD environment for the install. Mount the Exchange ISO and open an elevated CMD in the mounted ISO drive. I used an older exchange cumulative update (CU), but assume the process should work on newer CUs as well.
Run the following commands, this is the point where I did not do the research to figure out exactly what these do, but it made the install work.
Setup.exe /PrepareSchema /IAcceptExchangeServerLicenseTerms
The organization name is just a name that exchange uses, but from some quick research it seems like you only get 1 organization per forest when it comes to exchange. It also did not like special characters in the name.
Setup.exe /PrepareAD /OrganizationName:”<ORG NAME>” /IAcceptExchangeServerLicenseTerms
Setup.exe /PrepareAllDomains /IAcceptExchangeServerLicenseTerms
Installation
Next we actually move on to installing exchange.
In the mounted exchange ISO directory, double-click Setup.exe to bring up the installation wizard UI.
For the most part we can skip through the UI screens until we get to server role selection.
I skipped updates to keep the server vulnerable to recent exploits.
At server role selection, select Mailbox role
and the bottom check box to Automatically install Windows Server roles and features that are required to install Exchange Server
.
Let the installer do its thing, it may take a while and reboot when it finishes.
Post-Installaion
Microsoft has a list of post-installation tasks here, but they arent necessary for the lab environment.
Verification
In the start menu, look for the Microsoft Exchange Server 2019
folder and then open the Exchange Administrative Center
.
This will open in a browser with a login page.
Log in with the domain administrator creds.
You should be able to see the administrator mailbox and configure the exchange server to cater to your needs from here.