1

Can we set security group as site collection administrator using CSOM in PowerShell in SharePoint Online - Office 365? I tried but getting error like "Company Administrator is not a valid user." Also is there any way to set primary and secondary site collection admin using CSOM in PowerShell? I am using sharepoint online -Office 365. Any idea?

2 Answers 2

1

I know it’s possible On Premise, where I have tried it myself and had it working properly (even though it's not supported by Microsoft). My guess is that it will work on SPO-Site as well. Simply run the following PowerShell Command:

Set-SPOsite -secondaryowneralias "domain\group"

Reference: How we can add secondary administrator to sharepoint online site using powershell?

0
1

Somewhat old I know but just to say that officially at least, you cannot set the primary site collection administrator to be a group. However, you can add an AAD security group to the secondary administrators list.

You can do this directly via the web interface and though PowerShell using Set-SPOUser though you have to specify the group by the claims encoded identifier not by the name. So I assume (though I admit I've not yet actually tried) that you can also do this via CSOM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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