December 19

Office 365: Hide a user from the GAL when using Azure AD Connect

Error message: 

The operation on mailbox “John” failed because it’s out of the current user’s write scope. The action
‘Set-Mailbox’, ‘HiddenFromAddressListsEnabled’, can’t be performed on the object ‘John’ because the object
is being synchronized from your on-premises organization. This action should be performed on the object in your
on-premises organization.

How to fix it:

  1. Open Active Directory Users & Computers.
  2. Enable Advanced Features by clicking View > Advanced Features.
  3. Set the msExchHideFromAddressLists attribute to True

4. set the mailNickname field.