unable to add users to group

Glenn Maxwell 10,106 Reputation points
2021-03-19T05:33:44.24+00:00

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
t.RecipientTasks.AddDistributionGroupMember
+ 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,166 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,335 questions
0 comments No comments
{count} votes

Accepted answer
  1. Lucas Liu-MSFT 6,161 Reputation points
    2021-03-22T05:36:08.067+00:00

    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 94,911 Reputation points MVP
    2021-03-19T07:35:08.96+00:00

    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