question

GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 asked joyceshen-MSFT commented

mail enabled security group

Hi All
I am using exchange 2010 hybrid environment, I have a csv file in the below format. I want to add the below users to mail enabled security group, will the below syntax work in exchange online and exchange 2010
users
user1@contoso.com
user2@contoso.com

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

experts help me with the syntax to create a mail enabled security group from PowerShell in exchange 2010 and exchange online.

office-exchange-server-administrationoffice-exchange-online-itprooffice-exchange-hybrid-itpro
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @GlennMaxwell-2309, please mark any answers any as accepted so we can close this up. Thanks!

0 Votes 0 ·

"office-online-server-exchange" is used for technical questions about integrating Office Online Server with Exchange Server. As your issue is only related to Exchange, I will remove it and keep others.

0 Votes 0 ·

Hi @GlennMaxwell-2309 , do suggestions below help?

0 Votes 0 ·
AndyDavid avatar image
0 Votes"
AndyDavid answered AndyDavid edited

To mail-enable an existing on-prem security group ( and this will sync to 365/ Exchange Online with AADConnect)

 Enable-DistributionGroup -Identity group@contoso.com


Then to add the members:

 Import-csv C:\userlist.csv | % {Add-DistributionGroupMember -Identity group@contoso.com -Member $_.users -BypassSecurityGroupManagerCheck}


The -BypassSecurityGroupManagerCheck is needed if you don't own the group, so it should typically always be used.

More info:

https://docs.microsoft.com/en-us/powershell/module/exchange/add-distributiongroupmember?view=exchange-ps








5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

udara avatar image
0 Votes"
udara answered

Your syntax should be worked.
Please refer official document for further details.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

joyceshen-MSFT avatar image
0 Votes"
joyceshen-MSFT answered

Hi @GlennMaxwell-2309 , agree with the replies above, first make sure you have on-premises security groups mail-enabled so that they will able to be synced to Exchange Online.

Then run the command you provided above, they should work properly.


If an Answer 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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.