When setting up Hide from address lists in Azure AD Connect environment by setting msExchHideFromAddressLists to True, in exchange online is still not enabled.
To set the above attribute true via PowerShell, you can run the below commands
$user = Get-ADUser username –Properties *
$user.msExchHideFromAddressLists = “True”
Set-ADUser –Instance $user
Run the delta sync to update the attribute in Azure Active Directory Start-ADSyncSyncCycle -PolicyType Delta and wait for couple of minutes. Checked the user mailbox and Hide from address list is still unchecked
Checked on premises Active Directory and mailNickName attribute was not populated on user account. The mail nickname should be populated for every users in on premises Active Directory.
Set the mailNickname with alias of the user, set the msExchHideFromAddressLists set to True and run Delta sync, wait for couple of minutes and now user mailbox is hidden in the GAL in Office 365.
Conclusion:
1. It seems msExchHideFromAddressLists attribute is flowed by the Exchange Synchronization Rule
2. Most of the time mailNickname is not populated for the user objects, hence before starting the migration to Office 365, make sure that mailNickname is populated for all the users
3. This synchronization rule has a scoping filter which only applies the rule if the mailNickname IsNotNull
4. Run IdFix Directory Synchronization Error Remediation Tool to find any issues
Just FYI, if you want to update mail and mailNickname for all users in OU
Get-ADUser -Filter * -SearchScope Subtree -SearchBase “OU=OUName,DC=domain,DC=com” | Foreach-Object {Set-ADUser -Identity $_ -Email “$($_.samaccountname)@domain.com” }
Get-ADUser -Filter * -SearchScope Subtree -SearchBase “OU=OUName,DC=domain,DC=com” | ForEach-Object {Set-ADUser -Identity $_ -Replace @{mailNickname=$_.samaccountname}}
Cheers,
Recent Comments