unable to add users to group

Glenn Maxwell 10,751 Reputation points

Hi Experts

I have mail enabled security group in exchange online. i am trying to add few users using the below syntax.

Import-csv C:\data.csv | ForEach {Add-DistributionGroupMember -Identity group@Company portal .com -Member $_.users}

I am getting the below error. I am Global Admin and i dont have mailbox for my account.

You don't have sufficient permissions. This operation can only be performed by a manager of the group.
+ CategoryInfo : NotSpecified: (:) [Add-DistributionGroupMember], OperationRequiresGroupManagerException
+ FullyQualifiedErrorId : [Server=NJ1PT01RT7328,RequestId=ght56789-1234-458o-309j-26789456789f1,TimeStamp=3/19/2021
5:26:47 AM] [FailureCategory=Cmdlet-OperationRequiresGroupManagerException] D7689533,Microsoft.Exchange.Managemen
+ PSComputerName : outlook.office365.com

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,364 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,492 questions
0 comments No comments
{count} votes

Accepted answer
  1. Lucas Liu-MSFT 6,161 Reputation points

    Hi @Glenn Maxwell ,
    You could also run the following command to check whether your account defined in Manageby properties:

    Get-DistributionGroup | ft Name, ManagedBy -AutoSize  

    If there is not, please run the following command to add your account.

    Set-DistributionGroup SG1 -ManagedBy @{Add="<value1>", "<value2>", …} -BypassSecurityGroupManagerCheck  

    The following Microsoft KB article described a similar issue, you may have a look at it to know more details: (You don't have sufficient permissions) error when you try to remove or make a change to a distribution group


    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.

1 additional answer

Sort by: Most helpful
  1. Vasil Michev 99,936 Reputation points MVP

    Use the -BypassSecurityGroupManagerCheck switch:

    Import-csv C:\data.csv | ForEach {Add-DistributionGroupMember -Identity group@contoso.com -Member $_.users -BypassSecurityGroupManagerCheck }
    1 person found this answer helpful.
    0 comments No comments