mailNickname, also known as Alias, should generally be set to the username part of the UPN (or sAMAccountName). You can set it to random value if you prefer, but that can create some confusion.
mailNickname parameter sometimes empty in local AD
Hello,
Few days ago I've discovered a problem with hiding email addresses in GAL. Problem was that parameter msExchHideFromAddressLists was set to TRUE but in Admin Center in M365 it didn't changed and users could see this email address in Outlook.
What I've discovered is rule in AAD Sync that states mailNickname must be ISNOTNULL.
After changing mailNickname of a user his address was hidden, so it's a success, but...
We've got three on-prem AD which are synced to the cloud and some users that were created a long ago have and some of them don't have mailNickname. How does this parameter work? When it's set in local AD automatically and when not?
Because from my understanding now I'd have to use PowerShell to set that parameter to users logon name.
Or can it be set to whatever, for example "123"?
For all users we use E3 and E5 Security licenses.
Exchange Online
Windows for business Windows Client for IT Pros Directory services Active Directory
Microsoft Security Microsoft Entra Microsoft Entra ID
-
Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
2023-07-24T16:41:57+00:00
2 additional answers
Sort by: Most helpful
-
Aholic Liang-MSFT 13,886 Reputation points Microsoft External Staff
2023-07-25T05:23:00.2933333+00:00 Hi @ kd_gul ,
The mailNickname attribute is set automatically when a user is created in Active Directory, either through the Active Directory Users and Computers snap-in or through PowerShell cmdlets such as New-ADUser.
However, it can also be changed manually by using the Set-ADUser cmdlet or by editing the Attribute Editor tab in the user’s properties.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
-
Anonymous
2023-07-25T09:02:52.96+00:00 Hi,
@Aholic Liang-MSFT Not really. I've created user in AD snap-in and this attribute is not present. I've got like 50% users in AD w/o this parameter.
Ok, I've got that, but what does it really mean "it can create some confusion"?
Can you write some examples when this parameter is used?
Why would I need mailNickname attribute if I've got sAMAccountName with the same value?
Thank you for your help.