Extend Active Directory Schema to Include Exchange Attributes
In some cases Active Directory may not include Exchange attributes that are required to change some settings on Office 365 when a user is synced with Active Directory. In order to add those attributes the Active Directory Schema must be extended to include Exchange attributes. For example, the HiddenFromAddressListsEnabled setting in Office 365 cannot be set from Active Directory unless the msExchHideFromAddressLists attribute is present. NOTE: After the extending the AD Schema the msExchHideFromAddressLists setting will not sync unless the mailNickname attribute in AD is also set.
The process below will only extend the schema and Exchange is not fully installed.
To extend the AD Schema in Active Directory follow the steps below. In our example our Active Directory server is Server 2012 R2 and we are using the Exchange 2016 setup files. If you are using an older server, such as Server 2008 R2, you may have to use the Exchange 2013 setup files which can be found in a link below.
1. On the server where Azure AD Connect is installed download the Exchange 2016 Setup files from the following link.
If you need the Exchange 2013 setup files download from the following link.
2. Once the download is complete run the Exchange2016-x64 or Exchange2013 file and choose a location where the files will be extracted. In our example we will choose a desktop folder named Exchange.
3. Once the files have been fully extracted in step 2 open Powershell as an Administrator by right-clicking then selecting Run As Administrator. In the Powershell window change the directory to the Exchange folder where the Exchange files were extracted. In our example the change directory command is as follows.
4. Once the directory has been changed you need to start the extension of the AD Schema with the following command.
.\Setup.exe /PrepareSchema /IAcceptExchangeServerLicenseTerms
Once the Schema is extended you should see a message that says "The Exchange Server setup operation completed successfully" as shown in the following screen-shot.
5. Now that the AD Schema has been extended we need to Refresh the Schema in Azure AD Connect. To do that launch the Azure AD Connect Wizard (usually found on the desktop) then click Configure > Refresh Directory Schema as shown below > follow the steps until the Schema is refreshed.
6. At this point open Active Directory Users and Computers and double click a user. Next click the Attribute Editor tab and scroll down to verify the Exchange attributes are now listed (you can specifically look for the msExchHideFromAddressLists attribute as shown below). Note: If you do not see the Attribute Editor tab you need to enable Advanced Features by clicking on View > check Advanced Features in Active Directory Users and Computers.
7. With the AD Schema extended you can now set Exchange attributes in AD as well and remember that the msExchHideFromAddressLists attribute will not sync unless the mailNickname attribute is also set.