For easier admin of SiteGroups I like to nest  Security enabled Mail DistributionGroups from Exchange Online into SP SiteGroups. Sadly we cannot add UnifiedGroups aka “Office365 Groups”.

First connect to Exchange Online with PowerShell and run
PS>Get-DistributionGroup  Only the SecurityEnabled DGroups are avilable to add to a SP SiteGroup
Here’s the PS script I used to create the DonkeyKong DistributionGroup:
PS>New-Distributiongroup -name "Donkey Kongs" -alias "DonkeyKongs" -type "security" -primarysmtpaddress "" –members,,

The trick to add this DistGroup to a SP SiteGroup is to use “-primarysmtpaddress” as –LoginName like this:
PS>Add-SPOUser –Group “Administration Visitors” –LoginName  -Site
(See also Part2 – Add Users to SiteGroups, I like to use seperate .csv files)

Run the PS>Get-SPOSiteGroup -Site
Notice that the SecurityEnabled Distribution lists only displaying long UID. But in SharePoint it displays friendly.

– Offcourse you can add “normal” Microsoft Online Security Groups, in Cloud or from AD Sync – but these are not possible to mail enable,
Run PS>Get-MsolGroup


Using PS with Exchange Online

Exchange Online cmdlets

Manage Azure AD Using PowerShell

by Thorbjørn Værp on Nov 20, 2015 at 10:51 AM


Leave a Reply