Exchange Federation to Office 365 without Hybrid
Exchange Federation has been around a long time, but of course more recently any time you talk about integrating with Office 365 people start going down the hybrid route. What if you don’t want hybrid though, what if all you want is to be able to share free/busy information?
Let’s set the scene. We have a tenant called contoso.onmicrosoft.com which has some accepted domains abc.com (default), def.com and ghi.com. We also have an On-Premises Exchange 2010 or later organization which also has some accepted domains, abc.com (default), klm.com, nop.com. Notice that abc.com is in both Office 365 and On Premises. This could be because the desire is to migrate to or from Office 365, or there are other reasons that prevent the use of Hybrid.
How does Exchange process Free/Busy requests… At a high level from what I can work out it goes
- Is there a mailbox for the recipient you’re after, if so get availability from that mailbox
- Is there an object for the recipient you’re after, if so use the targetAddress (externalEmailAddress) else use the smtp address typed in
- Find an Organization Relationship that has that email domain listed in Domain Names and that allows Free Busy lookups
- if one found, then see if the organizer object has a proxyAddresses entry where the domain matches a federated domain, if so then use that entry as the source, otherwise use the smtp address
- Get a token from the Federation Gateway
- If the organization relationship has a TargetSharingEpr then use that, otherwise if there is a TargetAutodiscoverEpr then use that to find the SharingEpr, otherwise do an autodiscover process to try to find it, each time passing the federation token for authentication
- In the target organization it receives the incoming request and checks if the domain of the from address is in an organization relationship. If so then it allows the request (based on the pieces that are enabled) if not then HTTP 401 is returned (error 5037 in the free/busy screen)
- If the request is allowed and if the recipient is a mailbox then return the availability information
Now I’m a PowerShell guy so I’ll be talking in cmdlets not GUI images…
Step 1 is On-Premises Federation Trust
The on-premises Exchange Organization must have a trust with the Microsoft Federation Gateway
Get-ExchangeCertificate | ?{$_.subject -eq “CN=abc.com”} | New-FederationTrust -Name “Microsoft Federation Gateway”
# add the DnsRecord values from the output above to external DNS
Step 2 is On-Premises Organization Identifier
Step 3 is On-Premises Organization Relationship
- DomainNames should be the domains that are allowed to use this relationship (i.e. the caller domains)
- *AccessLevel and *AccessEnabled flags should ideally be the same on both side, but the least restrictive will apply
- Target* is how to reach the target or foreign organization
Step 4 is Office 365 Federation Trust
Step 5 is Office 365 Organization Identifier
Step 6 is Office 365 Organization Relationship
- DomainNames should be the domains that are allowed to use this relationship (i.e. the caller domains)
- *AccessLevel and *AccessEnabled flags should ideally be the same on both side, but the least restrictive will apply
- Target* is how to reach the target or foreign organization (in this case the on-premises environment)