Exchange is appending numbers to DL

Glenn Maxwell 14,186 Reputation points
2021-04-18T23:13:00.877+00:00

Hi All
i am using exchange2016 hybrid environment, i have created distribution list in exchange onprem by name Test Group.
But in AD i can see the group name as Test Group-396684025 in Group Name(pre-windows 2000). This is happening to all the DLs created in exchange onprem.
How to fix this.

Get-DistributionGroup Test.Group@Company portal .com | FL Name,DisplayName,SamAccountName

Name : Test Group
DisplayName : Test Group
SamAccountName : Test Group-396684025

  1. How do i change the SamAccountName for Test Group using exchange powershell.
  2. how do i create new DL from Exchange powershell where i can specify the SamAccountName
Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

Exchange | Exchange Server | Management
Exchange | Exchange Server | Management

The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.

Exchange | Hybrid management
Exchange | Hybrid management

The administration of a hybrid deployment that connects on-premises Exchange Server with Exchange Online, enabling seamless integration and centralized control.

Locked Question. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Lucas Liu-MSFT 6,196 Reputation points
2021-04-19T04:13:30.983+00:00

Hi @Glenn Maxwell ,
1.You could run the following command to change the SamAccountName for distribution group:

Set-DistributionGroup -Identity <> -SamAccountName <>  

88904-image.png

2.You could run the following command to specify the SamAccountName when you create a new distribution group:

New-DistributionGroup -Name <> -SamAccountName <>  

88889-image.png

3.Please note: According to the Microsoft's official article, we could know the following information:
The SamAccountName parameter (also known as the pre-Windows 2000 user account or group name) specifies an object identifier that's compatible with older versions of Microsoft Windows client and server operating systems. The value can contain letters, numbers, spaces, periods (.), and the following characters: !, #, $, %, ^, &, -, _, {, }, and ~. The last character can't be a period. Unicode characters are allowed, but accented characters may generate collisions (for example, o and ö match). The maximum length is 20 characters.

For more information you could refer to: Set-DistributionGroup and New-DistributionGroup


If the response is helpful, please click "Accept Answer" and upvote it.
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.

Was this answer helpful?

1 additional answer

Sort by: Most helpful
  1. swey 11 Reputation points
    2026-07-20T11:50:50.3733333+00:00

    It appears this behaviour was introduced in Exchange 2016 and remains present in later CUs:

    The reason behind this is:

    • Exchange EAC does not populate the sAMAccountName when creating a Distribution Group.
    • Active Directory therefore generates the sAMAccountName automatically and appends a numeric suffix to ensure uniqueness (for example, Test Group-396684025).

    Was this answer helpful?

    0 comments No comments