Site icon Franky's Web

Howto: Exchange Online Protection (EOP) with Exchange 2013 On-Premise

This article describes the basic configuration of Exchange Online Protection with Exchange Server 2013.

https://products.office.com/de-de/exchange/microsoft-exchange-online-protection-email-filter-and-anti-spam-protection-email-security-email-spam

These instructions are also valid for Exchange 2016.

Nachdem man einen Account hat, landet man im Office 365 Dashboard. Unter dem Punkt „Setup“ kann die Grundkonfiguration erfolgen:

Step 1: Add domain.

Ich verwende „frankysweb.com“ zum Testen:

Meine Domain hostet Strato, da Strato in der Liste für die Schrittanweisungen nicht aufgeführt ist, wähle ich „Allgemeine Anweisungen“ aus. Die Domain muss validiert werden, daher wird ein TXT Eintrag und alternativ ein MX Eintrag angezeigt um die Domain zu validieren. Ich verwende den TXT Eintrag:

To confirm the domain, only the TXT record is created. This works very simply with Strato:

Save settings and you're done

The domain is successfully validated using the TXT record:

Die gerade hinzugefügt Domain wird jetzt unter dem Punkt „Domänen“ angezeigt:

Als nächstes wird der Nachrichtenfluss zwischen dem lokalen Exchange Server und Exchange Online Protection (EOP) konfiguriert. Dazu wird im Office 365 Dashboard auf „Online Protection for Exchange“ geklickt

A new window will open with the Exchange Admin Center, here you should also see the domain you just added, you can double-click on the domain to open the settings:

Da die E-Mails von EOP zu Exchange weitergeleitet werden sollen, wird der Typ der Domain auf „Internes Relay“ umgestellt:

Now 2 connectors are required, which are added under Connectors.

Der erste Connector ist für den Empfang der Nachrichten vom lokalen Exchange Server zuständig. Also wird bei „Von“ die Einstellung „E-Mail Server ihrer Organisation“ und bei „An“ die Einstellung „Office 365“ vorgenommen:

The connector requires a descriptive name, such as Exchange-to-EOP

The next step is to enter the external IP address of the Exchange server. In small environments, this is likely to be the WAN IP. In my test environment, it is my public WAN IP:

Finally, a summary is displayed and the first connector is created

Der zweite Connector ist für das Weiterleiten der Nachrichten an den lokalen Exchange Server. Also wird bei „Von“ die Einstellung „Office 365“ und bei „An“ die Einstellung „E-Mail Server ihrer Organisation“ vorgenommen:

Auch hier wieder einen sprechenden Namen eingeben, beispielsweise „EOP-to-Exchange“

Im nächsten Dialog werden die entsprechenden Domains hinzugefügt, für die der lokale Exchange Server zuständig ist. Bei mehreren Domains mit mehreren Exchange Servern, werden entsprechend mehrere Connectoren angelegt. In meinem Fall ist es aber nur „frankysweb.com“:

Now the external IP address of the Exchange server must be entered again so that the mails can be sent from EOP to the local Exchange server:

As I use a self-signed certificate, which is not trustworthy for EOP, I select the TLS setting with all certificates:

A summary is also displayed here, but it goes one step further:

In the last step, the connector checks whether EOP is able to send mails to the local Exchange server. At this point, a connection on port 25 (SMTP) to the local Exchange server must be possible. Simple DNAT is normally sufficient here, which is restricted so that only EOP is allowed to deliver mails. With my Sophos UTM, I have created a DNAT entry (also known as SNAT) and restricted it accordingly:

Die Gruppe bei „Datenverkehrsquelle“ enthält dann alle EOP-IPs bzw. die EOP Netzwerke. Welche IPs von Microsoft derzeit verwendet werden, ist hier dokumentiert:

https://technet.microsoft.com/library/dn163583(v=exchg.150).aspx

In order for the connector to be created, an e-mail address must be entered for the test, in my case this is administrator@frankysweb.com:

Nach dem Klick auf „Überprüfen“ startet der Test:

The test should be successful:

In Exchange Admin Center „sollten“ nun 2 Connectoren angezeigt werden:

Strangely enough, the EOP-to-Exchange connector disappeared from the EOP portal after a short time. However, the connector is still there. You can check whether the connectors are present using PowerShell:

Get-InboundConnector | ft -AutoSize
Get-OutboundConnector | ft -AutoSize

A connection to EOP via Powershell is established as follows:

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.protection.outlook.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session

A list of available CMDLets can be found here:

https://technet.microsoft.com/de-de/library/dn621038(v=exchg.150).aspx

Once the message flow has been configured, the users can be created. In most cases, it is advisable to have the synchronization done automatically. To synchronize the local ActiveDirectory with EOP (or Azure AD), it must be set up:

Step 1: Prepare directory synchronization

In the first step there is an important point: If the local ActiveDirectory uses a name that is not the same as the e-mail domain, then the e-mail domain must be added as an alternative UPN suffix. Example:

The UPN for user Frank is therefore frank@frankysweb.local, so the alternative UPN suffix frankysweb.com must be assigned to user Frank so that the mapping of local user to EOP user works.

Das alternaive UPN wird in der Konsole „Active Directory-Domänen und Vertrauensstellungen“ hinzugefügt:

In order for the users to be assigned, the UPN must be changed for each user, the easiest way to do this is via the PowerShell (see note!!!). There is a corresponding script here:

http://blogs.technet.com/b/heyscriptingguy/archive/2013/08/13/add-user-principal-names-in-active-directory-via-powershell.aspx

But be careful: Changing the UPN for users should be planned carefully. Otherwise it could end in chaos if no user can log in...

It can be changed manually for individual users:

If you do not want to or cannot change the UPN, you can also import the users using a CSV file or Powershell. Step 2 can normally be skipped. So you can continue with step 3:

After clicking on Activate, the status should be displayed and the two tools can be downloaded:

Both tools are required on a domain controller. The ldfix tool can be used to fix synchronization problems in advance:

There have been no problems in my area:

The dirsync tool can therefore be installed

Nachdem das Tool installiert wurde, am besten das Häkchen bei „Konfigurations-Assistenten jetzt starten“ abwählen und vor der Konfiguration den Benutzter abmelden und wieder anmelden:

The wizard can be started after logging in via the start menu or via the desktop shortcut. The EOP user must be specified in the first dialog:

Im nächsten Dialog muss ein Benutzer mit Domain Administrator Rechten angegeben werden, zusätzlich muss der Benutzer Mitglied der Gruppe „FIMSyncAdmins“ sein, die bei der Installation erstellt wurde:

Der Modus „Hybride Bereitstellung“ erlaubt es, dass auch Änderungen von EOP in das lokale AD synchronisiert werden können, der Modus ist aber nicht zwingend erforderlich:

Password synchronization with Azure AD is also not absolutely necessary:

The configuration should be completed without errors:

Finally, the local AD can be synchronized with Azure:

The synchronization process can be monitored with the Synchronization Service Manager. The tool can be found under the following path:

C:\Program Files\Windows Azure Active Directory Sync\SYNCBUS\Synchronization Service\UIShell\miisclient.exe

Nachdem die Synchronisation abgeschlossen wurde, werden die Benutzer im Office 365 Portal unter „Aktive Benutzer“ angezeigt. Bei Benutzern mit geänderten UPN funktioniert die Zuordnung (rot), bei Benutzern ohne geänderten UPN nicht (blau)

Note: The local AD is synchronized with Azure AD every 3 hours. The interval can be adjusted via the following file:

C:\Program Files\Windows Azure Active Directory Sync\Microsoft.Online.DirSync.Scheduler.exe.Config

Here is the example for 1 hour:

Nach dem Anpassen der Datei, muss der Dienst „Windows Azure Active Directory Sync Service“ neugestartet werden. Die Synchronisation lässt sich auch manuell anstoßen, dazu kann ein PowerShell SnapIn aus folgendem Verzeichnis geladen werden:

C:\Program Files\Windows Azure Active Directory Sync\DirSync

Import modules .\DirSync.psd1
Start-OnlineCoexistenceSync

The EOP configuration is now complete, a small Exchange configuration and the conversion of the MX records are still missing.

First create the local Exchange send connector so that outgoing mails are routed via EOP:

New-SendConnector -Name "Exchange-To-EOP" -AddressSpaces * -CloudServicesMailEnabled $true -Fqdn "outlook.frankysweb.de" -RequireTLS $true -SmartHosts frankysweb-com.mail.protection.outlook.com -TlsAuthLevel CertificateValidation

The command must be adapted slightly:

-fqdn: specifies the external name of the Exchange server, normally this is the HELO entry that is also on the certificate

-smarthostsDomain TLD.mail.protection.outlook.com. Domain and TLD are separated by a hyphen

The old Send Connector can initially be deactivated or deleted directly

Finally, change the MX record at the provider (in my case Strato again):

Normalerweise ist der MX Reocrd auch domain-tld.mail.protection.outlook.com. Der MX lässt sich aber auch unter dem Punkt „Domänen“ mit einem Klick auf „DNS verwalten“ anzeigen:

The SPF entries that should be configured if the provider supports this are displayed here next to the MX:

Strato configuration for SPF:

Done, at least with the basic configuration...

Exit mobile version