Exchange 2016 Setup

16 November 2019 Off By Rached CHADER

The account to use to log in must be a member of the Organization Management group.

License Activation

You have 180 days before your server will not work anymore,  For that you have to go here:

Restart the information store service to consider your license.

Database

We will move the database as well as the logs, the best is to create a dedicated disk.

Open the Exchange Management Shell as administrator:

1
2
3
4
5
6
7
# <span class="tlid-translation translation" lang="en"><span class="alt-edited" title="">Rename DB:</span></span>

Set-MailboxDatabase "Mailbox Database 0123456" -Name "DB-NAME"

# <span class="tlid-translation translation" lang="en"><span class="" title="">Move the DB and log files:</span></span>

Move-DatabasePath "DB-NAME" -EdbFilePath "D:\DB-NAME\DB-NAME.edb" -LogFolderPath "D:\DB-NAME"

Accepted domains

Log in to the ECP, go to “mail flow”, then “accepted domains”, and make sure your domain appears in local domain Example “CHADER.PRIV”:

Internal DNS

We will define the internal DNS of our Exchange server:

Go to “Servers” => “servers”
Double-click on the server name
Go to “DNS lookup”, then press “+” below “Internal DNS Lookups”
Add the IP addresses of the DNS servers in my case I have the IPs of my domain controllers:

At this stage you can send emails internally, you have the opportunity to test with the creation of two mail accounts on your Exchange Server 2016.

External mail

As for internal mail, we will set the external domain and the format of e-mail addresses.

Go to “Mail Flow” => “accepted domains”> “+”
Indicate the desired “Name”
Indicate the “Domain” purchased from your host
Click on “Save”

At this point you should have two accepted domains, one externally and other internally, we will now define the addressing policy.

Email Address Format

 

Go to “Mail Flow” => “Mail Address Strategies”
“Default Policy” => “mail address format”> “+”
Select your external domain from the drop-down list
Choose the format of the mail address
Check “Set this format as reply mail address”
Click on “Save”

Do not forget to click on “Apply” in the menu on the right

Internal DNS

 

On your DNS server “Active Directory” we will create a new record: mail.chader.fr

Go to “Windows + R” => “dnsmgmt.msc”

Add a record in the new area:
Right click on “mail.chader.fr” => “New host (A or AAAA)”
Add the IP address of your Exchange server
Click on “Add a host”

Virtual Directories

 

We will use the following script:

Open an Exchange Management Shell window
Copy the following script into a Notepad

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$HostName = "EXC-01"

$URL = "mail.chader.fr"

Set-ClientAccessService -Identity $HostName -AutoDiscoverServiceInternalUri https://$URL/autodiscover/autodiscover.xml

Set-OwaVirtualDirectory -Identity "$HostName\OWA (Default Web Site)" -ExternalUrl https://$URL/owa -InternalUrl https://$URL/owa

Set-EcpVirtualDirectory -Identity "$HostName\ECP (Default Web Site)" -ExternalUrl https://$URL/ecp -InternalUrl https://$URL/ecp

Set-WebServicesVirtualDirectory -Identity "$HostName\EWS (Default Web Site)" -ExternalUrl https://$URL/EWS/Exchange.asmx -InternalUrl https://$URL/EWS/Exchange.asmx

Set-ActiveSyncVirtualDirectory -Identity "$HostName\Microsoft-Server-ActiveSync (Default Web Site)" -ExternalUrl https://$URL/Microsoft-Server-ActiveSync -InternalUrl https://$URL/Microsoft-Server-ActiveSync

Set-OabVirtualDirectory -Identity "$HostName\OAB (Default Web Site)" -ExternalUrl https://$URL/OAB -InternalUrl https://$URL/OAB

Set-MapiVirtualDirectory -Identity "$HostName\mapi (Default Web Site)" -ExternalUrl https://$URL/mapi -InternalUrl https://$URL/mapi

Set-ClientAccessServer -Identity $HostName –AutoDiscoverServiceInternalUri https://$URL/Autodiscover/Autodiscover.xml

Set-OutlookAnywhere -Identity "$HostName\RPC (Default Web Site)" -ExternalHostname $URL -InternalHostname $URL -ExternalClientsRequireSsl $true -InternalClientsRequireSsl $true -DefaultAuthenticationMethod NTLM

Modify the variables $ HostName (by putting the name of your server) and $ URL (indicating yours).
Save the file as .ps1

Send connector

To send messages outside our Exchange organization, we must create a Send connector.

Go to “mail flow” => “send connectors” => “+”

Give a “Name” to your connector
Check “Internet”
Then do “Next”:

In our case we will use the MX record

Click on “+”
In the “Domain” field, put “*”

Add your Exchange server

Receive connectors

 

We go to “mail flow” => “Receive connectors”
Change the “Default Frontend” connector => “FrontendTransport”
“Extended” => “FQDN”
Specify the full domain name in our case “mail.chader.fr”

 

External DNS

 

We will add 3 records in our DNS zone, via the interface of our host:

A record of type A that will match “mail.chader.fr” to the Public IP of our Exchange:
Name: mail
TTL: 3600
Resource Record Type (RR): A
Target: The public IP of the Exchange server

An MX type record that will manage the routing of Internet mail. It will therefore point to the FQDN created just before:
Name: Your domain
TTL: 3600
Resource Record Type (RR): MX
Target: The name of the mail server (for example, mail.chader.fr)

A CNAME record that will allow automatic mobile configuration:
Name: autodiscover
TTL: 3600
Resource Record Type (RR): CNAME
Target: The fully qualified domain name externally accessible from the Mailbox server (for example, mail.chader.com)
We will check the TXT type DNS configuration:
On Windows: Start => Run then type cmd
nslookup
set q = txt
domain name
We will check the MX type DNS configuration:
On Windows: Start => Run then type cmd
nslookup
set q = MX
domain name
We will check the autodiscover DNS configuration:
On Windows: Start => Run then type cmd
nslookup
set q = cname
domain name

Our tutorial is over we will discuss other aspects of configurations in another article, you can now use your Exchange Server 2016

Views: 663