locked
Add a Unified Group to a SharePoint Group using PowerShell RRS feed

  • Question

  • I've created a new Unified Group called "Students" using the New-UnifiedGroup cmdlet and that group is working just fine. Running the Get-MsolGroup cmdlet I can see that the group is created as a follows:

    ExtensionData             : System.Runtime.Serialization.ExtensionDataObject
    CommonName                :
    Description               : Students
    DirSyncProvisioningErrors :
    DisplayName               : Students
    EmailAddress              : Students@xxxxxxxx.onmicrosoft.com
    Errors                    :
    GroupType                 : DistributionList
    IsSystem                  : False
    LastDirSyncTime           :
    Licenses                  : {}
    ManagedBy                 :
    ObjectId                  : 33490857-35d6-46ae-927e-b33974a30591
    ProxyAddresses            : {SMTP:Students@xxxxxxxx.onmicrosoft.com}
    ValidationStatus          : Healthy

    I'd like to now add this new Unified Group to a SharePoint group using PowerShell. However, when I attempt to do so using the Add-SPOUser cmdlet I get an error that the specified user cannot be found. I tried to use the email address, the ObjectId, and the display name and neither worked. I validated that I can add the Unified Group to the SharePoint Group via the browser and retrieving the details of the group I see the following, which suggests that using the ObjectId to add the Unified Group should work, but it doesn't:

    DisplayName : Students
    LoginName   : 33490857-35d6-46ae-927e-b33974a30591
    IsSiteAdmin : False
    IsGroup     : True
    Groups      : {Team Site Visitors}

    Is it just not yet possible to add Unified Groups to SharePoint Groups using the SPO cmdlets or am I just missing something simple? Is there an alternative approach such as a REST call that would work?


    Gary Lapointe, Blog: http://blog.falchionconsulting.com/, Twitter: http://twitter.com/glapointe Aptillon Inc.: http://www.aptillon.com

    Friday, July 17, 2015 7:42 PM

All replies

  • Works fine for me via the primarySMTP:

    Add-SPOUser -Site https://tenant.sharepoint.com/ -Group "blabla" -LoginName Unified@domain.com

    Monday, July 20, 2015 6:44 PM
  • I've tried many times and that doesn't work for me. I wonder if there's a difference with tenant versions - I'm testing this on a recently created trial tenant.

    Gary Lapointe, Blog: http://blog.falchionconsulting.com/, Twitter: http://twitter.com/glapointe Aptillon Inc.: http://www.aptillon.com

    Monday, July 20, 2015 8:56 PM
  • Check also if you have the latest SPO PowerShell module installed.
    Tuesday, July 21, 2015 7:08 AM
  • Yup - using the latest version. I've tried from multiple machines with two different tenants (both recently created trials) and I get the same results.

    Gary Lapointe, Blog: http://blog.falchionconsulting.com/, Twitter: http://twitter.com/glapointe Aptillon Inc.: http://www.aptillon.com

    Wednesday, July 22, 2015 3:16 PM
  • Add-UnifiedGroupLinks -LinkType owners -Identity GROUPNAME -Links user@tenant.onmicrosoft.com

    There are 3 LinkTypes:

    • Owners
    • Members
    • Subscribers

    A user needs to be added to Members type first, before adding him to the Owners.

    MSDN Reference

    Wednesday, August 19, 2015 10:45 AM
  • Thanks for your response, unfortunately this doesn't help - what you have is for adding a user to a unified group - I'm trying to add a unified group to a SharePoint group.

    Gary Lapointe, Blog: http://blog.falchionconsulting.com/, Twitter: http://twitter.com/glapointe Aptillon Inc.: http://www.aptillon.com

    Wednesday, August 19, 2015 3:45 PM
  • I'm also unable to use Add-SPOUser with a Unified Group. Did you ever find a solution for this? 
    Friday, September 11, 2015 7:19 PM
  • Me too desperately trying to solve this... HELP?

    Saturday, April 1, 2017 7:24 PM