Deploying a Working Exchange Lab in Azure
In this free 9-part lab series, you will complete a set of guided lab tasks that will allow you to build out a basic, yet working, Exchange 2016 Organization that’s hosted completely in Azure.
Welcome to Deploying a Working Microsoft Exchange Lab in Azure!
In this free 9-part lab series, you will complete a set of guided lab tasks that will allow you to build out a basic, yet working, Exchange 2016 Organization that’s hosted completely in Azure. You will build out a single Windows Server 2016 Active Directory domain that is hosted on a domain controller called DC01, that runs on a virtual machine in Azure. An Exchange 2016 server, called EX01 (also a VM running in Azure), will be deployed to the Active Directory. The Exchange organization, which will be called “Exchange Lab” will accept mail for a single internet-routable email domain, called labtest365.com.
The entire environment will reside entirely in Azure. As such, due to Azure restrictions, the Exchange server WILL NOT be able to send emails out to the internet. However, the Exchange server WILL be able to RECEIVE internet emails, as well as send and receive internal emails (internal to the Exchange org).
Throughout this lab, you will:
While the primary intent of this multi-part lab (which has been excerpted from our paid video-based version of the lab) is to teach you how to deploy Microsoft Exchange, you can also use this lab as a foundation for our larger lab, entitled Performing a Full-Hybrid Exchange Migration to O365
The diagram below depicts what the final Exchange lab will look like. We’ll deploy two virtual machines in an Azure resource group called ExchangeLab. The virtual machines will be called DC01 and EX01, and they will be deployed to a virtual network with an address space of 10.1.0.0/16, on a subnet with an address range of 10.1.0.0/24. The virtual network will be called LabNetwork and the subnet will be called LabSubnet.
Port 3389 (RDP) will be opened to both VMs from the student’s workstation only. Ports 25, 443, and 8080 will be opened from the Internet to EX01.
The email domain we will use throughout this lab is labtest365.com, so the external access domain and Autodiscover records will be mail.labtest365.com and autodiscover.labtest365.com, respectively.
The Active Directory forest that we deploy will be called labtest365.local.
Before deploying resources to support the Exchange lab, you must first deploy a resource group in Azure. The resource group will contain all the Azure resources that comprise the lab. In this lab task, we’ll provision a resource group called ExchangeLab.
Complete the Following Tasks:
The resource group might take a few seconds to create. Once it is created, you see the resource group on the Azure portal dashboard.
To allow the Azure virtual machines to communicate with each other and with the internet, a virtual network needs to be created. In this lab task, we will create a virtual network called LabNetwork that contains a subnet called LabSubnet.
Complete the Following Tasks:
Leave the remaining values at their default settings and then click Create.
If you need additional assistance with this lab, you can enroll in the full, video-based version here.
The Exchange lab requires two virtual machines. One will serve as the domain controller and the other will host Exchange. In this lab, you’ll deploy the virtual machine that will ultimately serve as the domain controller.
Complete the Following Tasks:
Because the DC01 virtual machine is going to function as a domain controller and also provide DNS services for the active directory domain, you need to make sure that the internal IP address never changes. This is necessary because in azure, by default, IPs are given out via DHCP from Azure. If you don’t set the private IP to static, it could change later on, and break AD and DNS.
Complete the Following Tasks:
These steps ensure that the private IP address never changes, even when the VM is restarted through the azure portal.
Once the domain controller VM comes up, you need to prepare the data disk that you attached when you created the virtual machine. This data disk will be used to host Active Directory.
Complete the Following Tasks:
At this point, you can deploy the virtual machine that will function as the Exchange server. The virtual machine that you deploy should be sized to “DS3v2” so that the Exchange install can run without running out of resources. You can always resize the VM smaller AFTER Exchange has been installed.
Complete the Following Tasks:
Because the EX01 virtual machine is going to function as an Exchange server, you need to make sure that the internal IP address never changes. This is necessary because in Azure, by default, IPs are given out via DHCP. If you don’t set the private IP to static, it could change later on, and break Exchange.
Complete the Following Tasks:
This ensures that the private IP address never changes, even when the VM is restarted through the azure portal.
At this point, you need to stand up an Active Directory forest to host the Exchange organization. In this lab, you will install the Active Directory Domain Services on the DC01 virtual machine.
Complete the Following Tasks:
Once installation completes, you are ready to move onto the next step.
Once installation of AD Domain Services completes the server needs to be promoted to a Domain Controller. In this lab, you will promote the DC01 virtual machine to a domain controller in an Active Directory forest.
Complete the Following Tasks:
Note: Using a .local (or any other non-routable domain name) for AD is no longer a recommended practice. However, we are using one in this lab so that you can use this lab as the foundation for the Full-hybrid lab, if you wish to take that later.
If you’re going to configure a lab environment, you might as well do it correctly. As such, you need to properly configure Active Directory Sites and Services, now that the Domain Controller is up and running. In this lab, you’ll configure the default AD site to properly reflect the deployed subnet address range.
Complete the Following Tasks:
When you’ve completed the steps above, continue on to the next step below.
Virtual machines that connect to a virtual network will register with the DNS servers that are specified for the virtual network. They will also use the specified DNS server for name resolution. Since your VMs will need to be able to resolve the AD domain, you’ll need to specify custom DNS servers for the virtual network that your VMs are attached to.
Complete the Following Tasks:
If you need additional assistance with this lab, you can enroll in the full, video-based version here.
Before installing Exchange on the EX01 server, the server must be joined to the AD domain. In this lab, you’ll join the EX01 virtual machine to the Active Directory domain.
Complete the Following Tasks:
When you’ve completed the steps above, continue on to the next step below.
The Exchange server in this lab will host the Mailbox server role. However, before installing the Mailbox Role, we need to install several prerequisites that support the Mailbox Role. In this lab, you’ll install the necessary Exchange prerequisites on EX01.
Complete the Following Tasks:
If prompted to reboot during the install process, do so.
The initial installation of Exchange in an AD environment requires an Active Directory schema update. Since your lab doesn’t have an existing Exchange server installed, you’ll need to prepare AD before installing Exchange. You’ll prepare AD for Exchange 2016 in this lab.
Complete the Tasks Below:
Setup will launch but it won’t actually install Exchange. It will simply update the AD schema.
After preparing Active Directory, Exchange can be installed on the EX01 server. For this project, you will install just the Mailbox server role, since it contains all the components required to run an Exchange Server 2016 server. You can, optionally, install the Edge Transport role, but that is not a mandatory role and is not used in this lab.
Complete the Following Tasks:
The installation process is SLOW. Let it do its thing. After setup completes, restart the server.
To save on costs, you can try resizing the EX01 virtual machine down, once Exchange has been installed. Personally, I’ve had mixed results with running Exchange on anything smaller than a DS3v2 virtual machine, but to save costs, it can’t hurt to try and size things down a bit. In this lab, you’ll resize the EX01 virtual machine to something smaller.
Complete the Following Tasks:
When the resize completes, ensure that all Exchange services are running as expected and that you can access the EAC. If you can’t, choose a larger size.
If you need additional assistance with this lab, you can enroll in the full, video-based version here.
To configure the new Exchange server to receive mail, you first need to add an accepted domain. In this exercise, you’ll add the domain that you registered with GoDaddy.
Complete the Following Steps:
When you’ve completed the steps above, continue on to the next step below.
When install your first Exchange Server 2016 or Exchange 2019 server, the server isn’t able to send mail outside of your Exchange organization. To send mail outside your Exchange organization, you need to create a Send connector. Although Azure restrictions prevent a VM from sending SMTP traffic out, the server should still be configured correctly – and this includes a send connector.
Complete the Following Steps:
After you create the send connector, it appears in the send connector list.
To ensure mailboxes created in Exchange get an email address that matches the accepted domain, you need to modify the default email address policy so that it stamps mailboxes with the email domain. In this exercise, you’ll modify the default email address policy in Exchange.
Complete the Following Steps
When you’ve completed the steps above, continue on to the next step below.
After installing Exchange, various virtual directory URLs must be configured, because Exchange uses these URLs to provide various Exchange services. Each virtual directory has a different URL that can be the same or different for internal users vs external users. Because you are using a split DNS in this lab, you’re going to configure the internal and external URLs to be the same. This is a common configuration.
Before configuring the URLs, you need to decide what name you want to use to access exchange, both internally and externally. For this lab, you are going to access Exchange via a FQDN of mail.labtest365.com internally and externally. The virtual directories we are most concerned with are OWA, ActiveSync, Autodiscover, ECP and Outlook Anywhere.
Complete the Following Steps to Configure the External Access Domain:
Complete the Following Steps to Configure the Virtual Directory URLs:
When you’ve completed the steps above, continue on to the next step below.
Exchange 2016 now uses MAPI over HTTP protocol by default. Outlook Anywhere, which is RPC over HTTP, is used as a fallback method if clients don’t support MAPI over HTTP. The Outlook anywhere feature is used by outlook to connect to an Exchange server over the Internet. In this exercise, you’ll configure Outlook Anywhere.
Complete the Following Tasks:
When you’ve completed the steps above, continue on to the next step below.
After configuring Outlook Anywhere, we need to configure the MAPI over HTTP URL. The MAPI over HTTP URL can only be configured via the Exchange Management Shell.
Complete the Following Steps:
If you need additional assistance with this lab, you can enroll in the full, video-based version here.
Before you can begin using Exchange, DNS needs to be configured to support it. In this lab, you’ll modify public DNS to support Exchange.
Complete the Following Tasks:
The changes we make will facilitate mail delivery to the Exchange server while facilitating Outlook connectivity to the Exchange server as well.
In much the same manner that public DNS was configured, you need to configure the internal Active Directory DNS to support the Exchange organization as well. Because you are using a .local domain name in this lab, you’ll need to setup split-DNS in our AD DNS environment. I did this intentionally because you are likely to see this type of DNS configuration in the real world.
Complete the Following Tasks to Create a Forward Lookup Zone in AD DNS:
Once you’ve provisioned the new zone, you need to add two DNS records to it. You need to add a HOST record and a CNAME record, just like you did when you configured public DNS. However, instead of pointing the HOST record (mail.labtest365.com) at the public IP address of the Exchange server, you need to point it at the private IP address. The CNAME record is created in the same way that it was created in public DNS.
Complete the Following Tasks to Add the Necessary Internal HOST Record:
Complete the Following Tasks to Add the Necessary Internal CNAME Record:
Making these changes won’t have any real visible impact on the lab’s functionality, but it is the proper way to configure split-DNS. In a production environment, what this would do, is ensure all workstations on the local LAN (that use AD DNS resolution) resolve mail.labtest365.com and autodiscover.labtest365.com to the INTERNAL address of the Exchange server, rather than taking people OUT of the local network and back in.
To allow email to flow into the Exchange organization from the internet, you need to create an MX record in public DNS. The MX record that you create needs to point to the public IP for the Exchange server.
Complete the Following Tasks:
After waiting for a few minutes, confirm that the MX record is being seen by performing an MX lookup for the email domain, using mxToolbox.
If you need additional assistance with this lab, you can enroll in the full, video-based version here.
In this lesson, you’re going to create a certificate request on the Exchange server so you can use an actual third-party trusted certificate. After all, this is what’s used in production environments. Once you have the certificate request created, you’ll move into the next lesson, were you’ll purchase a cert from Sectigo and then install it on the exchange server.
What you’ll do, is create a certificate request from within the Exchange Admin Center – and then supply the information from the certificate request to Sectigo, so they can provide you with a working certificate.
Complete the Following Tasks:
You can see now that the certificate request appears in the list of Exchange certificates with a status value of Pending. In the next lesson, you’ll provide this cert request to Sectigo so they can generate a cert for you.
Since you’re purchasing a certificate for a lab environment, you don’t want to go broke doing so. That said, what I do for my lab environments is use gogetssl.com to find the cheapest UCC or multi-domain cert I can find. GoGetSSL usually has them for as low as 20 bucks or so.
Once you purchase the Sectigo cert from GoGetSSL, you’ll use the certificate request that you generated earlier to create and download the actual certificate. Feel free to purchase a multi-domain or UCC certificate from wherever you wish. However, if you want to follow along with this lab, purchase a cert from Sectigo/Comodo through GoGetSSL.
As part of the certificate purchase process, you’ll need to validate ownership of your email domain before the certificate provider will generate a certificate for you. For this lab, we purchased our certificate from GoGetSSL / Sectigo. If you do the same, you’ll need to verify domain ownership before they release the certificate to you. Follow their instructions for domain verification.
After obtaining the certificate from Sectigo, you need to complete the certificate request on the Exchange server so that you can assign the new certificate to the Exchange services.
Complete the Following Tasks:
The certificate request will become a certificate in the list of Exchange certificates with a Status value of Valid.
Once the new certificate is acquired and the request is completed, the new certificate needs to be assigned to the Exchange services so that Exchange uses the new certificate.
Complete the Following Tasks:
What this does is assign the newly installed certificate to the selected Exchange services. Moving forward, you should be able to begin securely accessing the EAC and OWA via https://mail.youremaildomain.com. We’ll test this in the next lesson.
Once you know everything is accessible as expected, you’ll want to lock down RDP on the lab subnet. What you don’t want, is RDP being open to the entire internet. So, what we’re going to do here, is limit RDP access on the lab subnet to just my workstation IP address.
Complete the Following Tasks to Lock Down RDP:
What the RDP rule will do is block inbound RDP access from all locations EXCEPT your workstation. In addition to locking down RDP, you also need to allow port 8080 and port 443 in, because you need to be able to access Exchange on these ports from the internet.
Complete the Following Tasks to Allow HTTPs Traffic:
By creating these rules, you can ensure that only YOU have access to the lab machines from the internet.
After you’ve completed the NSG configuration, restart both virtual machines so they pick up the changes.
CAUTION: If you lock down RDP to your workstation IP address, you are going to lose RDP access to your VMs if your pubic IP address from your ISP ever changes. Keep this in mind.
After you’ve finished configuring Exchange, installing the certificate, setting up DNS, and configuring URLs, you can test the Exchange EAC to confirm that everything works as expected.
To do so, browse to https://mail.labtest365.com/ecp from your workstation. Because HTTP and HTTPs have both been allowed in, via a Network Security Group, you should have no issues accessing the EAC from your workstation.
After connecting to the EAC, click around and make sure everything is accessible.
At this point, you can begin testing mailbox access and mail flow.
Complete the Following Tasks:
After confirming that mail flow is working, test for Outlook connectivity. More specifically, check to make sure Autodiscover is working for Outlook clients.
Complete the Following Tasks:
If everything is working as it should, you’ll see Outlook complete the connection and you’ll be able to open the mailbox.
With the Exchange lab wrapped up, you can stop and deallocate the virtual machines from the Azure portal so charges for them don’t continue to accrue.
Complete the Following Tasks:
If the virtual machines don’t show Stopped (Deallocated), you will continue to be charged for them.