0

Good morning all,

I've ran into an issue with Sharepoint online. Normally when we run get-spositegroup we get the following results. I've removed some of the info but there's a user and a role assigned to the group. This way we can manage some of the site settings.

get-spositegroup

Now for the actual problem. We found a couple of sites where the assigned useraccount has been deleted, and there's no role assigned to the group. This causes problems managing the site. In this image I've removed the GUID from the useraccount (which no longer exists) but you can see there's no role assigned to the group. get-spositegroup

I would like to assign a new user to the owner and member groups, so that we can properly manage these sites. I run the following command:

$ownerGroup = Get-SPOSiteGroup -Site https://xxx.sharepoint.com/sites/xxx -Group "xxx Owners"
Set-SPOSiteGroup -Site https://xxx.sharepoint.com/sites/xxx -Identity "account@ompany.onmicrosoft.com" -Owner $ownerGroup

However this returns "Set-SPOSiteGroup : Group cannot be found", although it is stored in the $ownerGroup variable. Tried googling this message but the only results I found were used for Sharepoint on-prem, not o365. Am I doing something wrong here?

1

The identity is set to identify the group you are going to set. And the owner is the new owner account you are going to grant.

Reference: https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/set-spositegroup?view=sharepoint-ps enter image description here

3
  • Ah, thanks, I was mixing up the owner and the identity. But now I run into something else - not having access to the resource. Even though the account I'm using has the Sharepoint Admin role in Azure AD, I get "Set-SPOSiteGroup : Access denied. You do not have permission to perform this action or access this resource." Is there a way to force access? – iki58762 Nov 12 '20 at 13:25
  • Well nevermind, first I need to run Set-SPOSite -identity <sitename> -owner <admin@company.onmicrosoft.com> -nowait, then I can execute the Set-SPOSiteGroup command. – iki58762 Nov 12 '20 at 14:02
  • @iki58762 Seems the issue get solved. You can accept the reply as answer if you have no further questions. – Jerry_MSFT Nov 13 '20 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.