In a previous article, you learned how to list users not inheriting email address policy.…
You have a failed Exchange Server, an attacked Exchange Server, or an Exchange Server with many issues. That’s not something you want to have. What you want is an Exchange Server that’s up and running without any issues because stability and security are essential. This article will show how to rebuild or recover an Exchange Server from a backup.
Table of contents
- When to recover Exchange Server?
- How to recover Exchange Server
- Step 1. Check current situation
- Step 2. Reset Exchange Server computer account
- Step 3. Install Windows Server
- Step 4. Download Exchange Server
- Step 5. Install Exchange Server prerequisites
- Step 6. Create disk drives or mount points
- Step 7. Set account permissions
- Step 8. Get Exchange location path
- Step 9. Recover Exchange Server
- Step 10. Import and assign SSL certificate
- Step 11. Extra checks
The Exchange Server is attacked, or it’s not starting anymore. What to do now? In this case, it’s best to recover Exchange Server. In our example, we have 1x Exchange Server 2019 (EX01-2019) running in the organization that we like to rebuild.
When to recover Exchange Server?
There are different reasons why you want to recover Exchange Server:
- Exchange Server attack
- Exchange Server crashing
- Exchange Server not starting
A standalone Exchange Server is a server that is not a member of a DAG. It means that when one Exchange Server is offline, the mailboxes will not switchover to another server.
Note: One of the big reasons you want to configure an Exchange DAG is for High Availability. If one Exchange Server fails, the mail flow in the environment keeps on going until you repair or rebuild the broken Exchange Server.
What if you have an Exchange Server which is a DAG member and failed? The approach is different, and you can follow Recover Exchange DAG member server.
Important: Configure a backup for Exchange Server. An Exchange recovery does not get your mailbox data back. It will only restore the configuration.
How to recover Exchange Server
Let’s look at how to recover a standalone Exchange server step by step.
Step 1. Check current situation
Exchange Server 2019 is running in the organization with computer name EX01-2019. That’s the Exchange Server that we like to recover. If the Exchange Server is offline and you can’t start it up, you can proceed further.
The information shown here makes it easier to understand what’s currently running.
There are 2 mailbox databases mounted.
The drives look like this.
Step 2. Reset Exchange Server computer account
Reset the Active Directory computer account for the failed Exchange Server. We will do that because:
- We will be able to rejoin the new server to Active Directory under the old computer name
- It allows the recovery process to retrieve all configuration data from Active Directory for the failed Exchange Server
Important: Do NOT DELETE the computer account but RESET the computer account.
Start Active Directory Users and Computers (ADUC). Find the Exchange Server computer account. Right-click the computer account and click on Reset Account.
Step 3. Install Windows Server
Build a new Windows Server or deploy one from a template. Make sure that you:
- Activate Windows Server
- Download and install the latest Windows Updates
- Configure computer name with the same name as the old one
- Configure static IP address with the same IP address as the old one
- Join the computer to the domain
Note: The target server must use the same version of Windows Server as the failed server. For example, you can’t recover a failed Exchange 2016 server that was running Windows 2012 R2 on a new server that’s running Windows 2016, or vice-versa.
In our example, we configured Windows server 2019 with the name EX01-2019. The internal IP address is 192.168.1.52 and joined to the domain exoip.local.
Step 4. Download Exchange Server
Go to the following page to get a list of the Exchange Server versions. The page will show you the Exchange Server build numbers and release dates. Scroll down to the Exchange Server that you need. Download and save the ISO image. Microsoft does remove older Exchange CUs when newer versions are released. You can use an unofficial website to download an older Exchange Server ISO file.
Suppose you do not have the installation media for the Cumulative Update (CU) version that was installed on the server to be recovered, you can recover a server using the latest available Cumulative Update. Once the upgrade is successful, AdminDisplayVersion in Exchange Management Shell or msExchVersion attribute on the recovered server will show the old build number and this is cosmetic in nature. We can either run setup /m:upgrade /IAcceptEchangeServerLicenseTerms or wait for the next Cumulative Update release and perform the upgrade which will correct this.
In our example, we will download and recover Exchange Server EX01-2019 with the latest available Exchange Server 2019 Cumulative Update.
Step 5. Install Exchange Server prerequisites
Read more in the article Install Exchange Server prerequisites.
Note: The target server should have the same general performance characteristics and hardware configuration as the lost server.
- Install required Windows components
- Install .NET Framework
- Install Visual C++ Redistributable for Visual Studio 2012
- Install Visual C++ Redistributable Package for Visual Studio 2013
- Install IIS URL Rewrite Module
- Install Unified Communications Managed API 4.0 Runtime
After all of the above tasks are completed, reboot the server.
Step 6. Create disk drives or mount points
Read more in the article Configure ReFS volume Exchange 2013/2016/2019.
Note: The same disk drive letters that were used for mounted databases on the lost server must also exist on the target server.
In our example, we didn’t create the disks and copy the mailbox databases to it. That’s because the database and log files are on separate disks. So the only thing we had to do is add the existing virtual hard disks on the Virtual Machine EX01-2019.
The drives look like this.
The database DB01.
The database DB01 logs.
Suppose you have the mailbox databases on the same Exchange Server hard disk. Copy the mailbox databases from a backup and mount them on the Exchange Server that you will recover too.
Step 7. Set account permissions
The account that you’ll use to make the server recovery requires the following permissions:
- Domain Admins security group membership
- Exchange Organization Management role group membership
Step 8. Get Exchange location path
If Exchange is installed in a location other than the default location of %ProgramFiles%\Microsoft\Exchange Server\V15, you must include the /TargetDir:<Path> switch in the Setup.exe /Mode:RecoverServer command to specify the location of the Exchange program (binary) files. If you don’t use the /TargetDir switch, the Exchange files will be installed in the default location when you recover the Exchange server.
Note: Check the failed Exchange Server location. If it’s not in the default location, you must include the target directory in the command.
To find the install location of Exchange on the lost Exchange server, do the following steps:
Open Administrative Tools and start ADSI Edit. Another way is to type adsiedit.msc in the Windows Search. Once opened, right-click ADSI Edit in the left pane and select Connect to. Select Configuration in the well known Naming Context. Click OK.
Navigate in ADSI Edit.
Configuration > CN=Configuration,DC=exoip,DC=local > CN=Services > CN=Microsoft Exchange > CN=EXOIP > CN=Administrative Groups > CN=Exchange Administrative Group (FYDIBOHF23SPDLT) > CN=Servers.
Right-click the failed Exchange Server object. Select Properties.
Find the msExchInstallPath attribute. This attribute stores the current installation path. In our example, the default Exchange install location was used. So, we will not use the /TargetDir:<Path> switch.
Step 9. Recover Exchange Server
Mount the Exchange Server ISO.
Start Command Prompt as administrator. Run the Setup.exe /Mode:RecoverServer command to restore Exchange Server. In our example, the ISO is mounted to the I: drive.
C:\>I:\Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF /Mode:RecoverServer Microsoft Exchange Server 2019 Cumulative Update 11 Unattended Setup Copying Files... File copy complete. Setup will now collect additional information needed for installation. Languages Mailbox role: Transport service Mailbox role: Client Access service Mailbox role: Mailbox service Management tools Mailbox role: Client Access Front End service Mailbox role: Front End Transport service Performing Microsoft Exchange Server Prerequisite Check Configuring Prerequisites COMPLETED Prerequisite Analysis COMPLETED Configuring Microsoft Exchange Server Preparing Setup COMPLETED Stopping Services COMPLETED Copying Exchange Files COMPLETED Language Files COMPLETED Restoring Services COMPLETED Language Configuration COMPLETED Mailbox role: Transport service COMPLETED Mailbox role: Client Access service COMPLETED Mailbox role: Mailbox service COMPLETED Exchange Management Tools COMPLETED Mailbox role: Client Access Front End service COMPLETED Mailbox role: Front End Transport service COMPLETED Finalizing Setup COMPLETED The Exchange Server setup operation completed successfully. Setup has made changes to operating system settings that require a reboot to take effect. Please reboot this server prior to placing it into production.
Exchange Server recovery finished. Reboot the server.
Step 10. Import and assign SSL certificate
The /Mode:RecoverServer switch assigns a self-signed certificate to all Exchange Services that require SSL/TLS. If the server previously used an SSL/TLS certificate that was issued by a different certification authority, you’ll need to re-import the certificate and configure the services to use the certificate. Otherwise, users will get a certificate prompt when they try to connect (for example, in Outlook).
Step 11. Extra checks
After the recovery, go through the below configurations and configure them if it’s not set:
- Mount mailbox databases
- Exchange Server license
- Virtual directories URLs
- Send connector
- Receive connector
- Custom IIS settings
Note: Everything stored on Exchange Server will not recover. Only what’s stored in Active Directory.
You learned how to recover Exchange Server. Run the recover switch to recover a failed Exchange Server and go through all the post checks. Ensure that everything is set like it was. If you want to recover or rebuild Exchange Server, the same steps apply.
Did you enjoy this article? You may also like Get Exchange mailbox database mount status with PowerShell. Don’t forget to follow us and share this article.