Office 365 and Active Directory

In this document we discuss how Outlook Profiler can read information from AD. At a minimum Outlook Profiler needs to know the ExchangeGUID (Outlook 2013-) and a value that can resolve to the Mailbox name. In some instances you can use the value outlook.office365.com in place of the actual ExchangeGUID.

If you need to know the ExchangeGUID because outlook.office365.com fails
The ExchangeGUID is stored as msExchMailboxGuid. It will be present when using an on premises Exchange 2013+ server or when two way sync with Office 365 has been preformed. You can also add this value for mail enabled users to your AD manually with tools like Adsiedit. You will use the ExchangeGUID combined with the domain to create the Personalized Server ID.

Mailbox name
A suitable Mailbox name value can be stored in more than one AD location. Sometimes the environment variable %username% when expanded by the PC, might match the mailNickName (Exchange Alias), and can be used. Failing that, try the Mail or userPrincipalName AD properties. In some cases, the full path to the mailbox must be specified using LegacyExchangeDN. Use whatever works for your environment.

Step 1:
Edit the profiler.ini file and set ReadActiveDirectory=1. Leave GetActiveDirectory set to the defaults.

Step 2:
Set the ExchangeGUID and Mailbox name. Try setting ExchangeServerName=outlook.office365.com first. Failing that, use msExchMailboxGuid as shown.

ExchangeServerName=%AD_msExchMailboxGuid%@domain.com
MailboxName=%AD_userPrincipalName%

Step 3:
Enable Anonymous Authentication and Outlook Anywhere (aka Outlook over HTTP) like so:

EncryptDataBetweenOutlookExchange=0
LogonNetworkSecurity=3
ConnectExchangeUsingHTTP=1
ConnectWithNetwork=1
ExchangeServerProxyName=outlook.office365.com
ConnectUsingSSLOnly=1
MutuallyAuthenticateSessionSSL=1
PrincipalNameProxyServer=msstd:outlook.com
AuthenticationConnectingExchangeProxy=0

Note:
Sometimes you need to set MailboxName to be %AD_Mail% or try %AD_LegacyExchangeDN%. Use whatever works in your environment. For Outlook 2016, the ExchangeServerName key should be set to AUTO.