You can’t set a security group as a site owner when you use the Set-SPOUser cmdlet in the SharePoint Online Management Shell

PROBLEM
Assume that you synchronize an Active Directory security group with your organization, and you want to change the site owner for a site collection. When you try to use the Set-SPOUser cmdlet in the SharePoint Online Management Shell to add or remove a security group as a site owner, the group isn't added or removed as an owner. Additionally, you receive the following error message:

+ CategoryInfo : NotSpecified: (:) [Set-SPOUser], ServerException
+ FullyQualifiedErrorId :
Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSPOUser
Workaround
To work around this problem, use the full account name for the security group in the LoginName parameter for the cmdlet. To locate the full account name, follow these steps:
  1. Sign in to the Office 365 portal.
  2. Browse to the affected site collection.
  3. Click the gear icon, and then click Site settings.
  4. In the User and Permissions section, click People and groups.
  5. In the address bar for the People and Groups page, locate the MembershipGroupId= section in the URL.
  6. Update the URL by changing the MembershipGroupId= value to 0, and then press Enter.
  7. Click the affected security group to open the User Information page.
  8. Locate the Account value for the full account name.

    Note This value begins with c:0-.f|rolemanager|and ends with a globally unique identifier (GUID).
  9. Run the Set-SPOUser cmdlet by using the full account name. For example, run the following command:
    Set-SPOUser -Site https://contoso.sharepoint.com/sites/<SiteCollectionName> -LoginName "c:0-.f|rolemanager|<GUID>" -IsSiteCollectionAdmin $true
MORE INFORMATION
For more information about the Set-SPOUser cmdlet, see the following TechNet topic:

Still need help? Go to the Office 365 Community website.
Properties

Article ID: 3133688 - Last Review: 01/13/2016 00:33:00 - Revision: 2.0

Microsoft SharePoint Online

  • o365 o365e o365p o365a o365m o365022013 KB3133688
Feedback