unable to add users to DL

Glenn Maxwell 10,146 Reputation points
2022-01-25T05:03:20.473+00:00

Hi All

I am facing issue adding users to a DL as there is & symbol in the DL alias. Experts guide me how to add users to the DL

Import-CSV C:\temp\input.csv | ForEach {Add-DistributionGroupMember -Identity test1&test@mydomain.com -Member $_.users -BypassSecurityGroupManagerCheck}

will the below syntax work for me.

Import-CSV C:\temp\input.csv | ForEach {Add-DistributionGroupMember -Identity test1"&"test@mydomain.com -Member $_.users -BypassSecurityGroupManagerCheck}

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,168 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,339 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 95,081 Reputation points MVP
    2022-01-25T07:30:46.773+00:00

    Put the entire name of the DL in single quotes, 'test1&test@mydomain.com'. Or "escape" the & symbol by adding ` in front of it. Or use a different identifier for the group, such as the GUID.

    Import-CSV C:\temp\input.csv | ForEach {Add-DistributionGroupMember -Identity 'test1&test@mydomain.com' -Member $_.users -BypassSecurityGroupManagerCheck}
    
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. KyleXu-MSFT 26,206 Reputation points
    2022-01-25T07:57:55.517+00:00

    @Glenn Maxwell

    Here is an example of it:
    168176-qa-kyle-15-57-25.png


    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.


    0 comments No comments