SOLVED
Home

Add AD Security group as Site collection administrator - SPO

%3CLINGO-SUB%20id%3D%22lingo-sub-815763%22%20slang%3D%22en-US%22%3EAdd%20AD%20Security%20group%20as%20Site%20collection%20administrator%20-%20SPO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-815763%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20add%20a%20security%20group%20as%20Primary%20or%20secondary%20site%20collection%20administrator%20to%20all%20the%20sites%20in%20the%20tenant%20via%20PowerShell%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%20this%20works%20for%20adding%20a%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Euser%20account%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20all%20the%20sites%20as%20SC%20Admin%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24Sites%20%3D%20Get-SPOSite%20-Limit%20ALL%20Foreach%20(%24Site%20in%20%24Sites)%20%7B%20Set-SPOUser%20-site%20%24Site.Url%20-LoginName%20%24AdminName%20-IsSiteCollectionAdmin%20%24True%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20same%20command%20with%20Set-SPOSiteGroup%20does%20not%20work%20Set-SPOSiteGroup%20%3A%20A%20parameter%20cannot%20be%20found%20that%20matches%20parameter%20name%20'IsSiteCollectionAdmin'%3C%2FP%3E%3CP%3ESince%20'IsSiteCollectionAdmin'%20is%20not%20accepted%20with%20Set-SPOSiteGroup%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestions%20on%20how%20to%20set%20security%20group%20as%20site%20collection%20administrator%20via%20PS%20script%2F%20cmdlets%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-815763%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPermissions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-816041%22%20slang%3D%22en-US%22%3ERe%3A%20Add%20AD%20Security%20group%20as%20Site%20collection%20administrator%20-%20SPO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-816041%22%20slang%3D%22en-US%22%3EThat's%20not%20correct...you%20can%20add%20an%20AD%20Security%20Group%20as%20site%20collection%20admins%20with%20no%20problems%20and%20it%20can%20be%20also%20done%20through%20PS%3A%20%3CA%20href%3D%22https%3A%2F%2Fkirkbarrett.wordpress.com%2F2016%2F04%2F04%2Fadding-an-o365-security-group-to-the-site-collection-administrators-group%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fkirkbarrett.wordpress.com%2F2016%2F04%2F04%2Fadding-an-o365-security-group-to-the-site-collection-administrators-group%2F%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-816059%22%20slang%3D%22en-US%22%3ERe%3A%20Add%20AD%20Security%20group%20as%20Site%20collection%20administrator%20-%20SPO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-816059%22%20slang%3D%22en-US%22%3Eyou%20right%2C%20I%20thought%20he%20is%20asking%20for%20the%20Office%20365%20nested%20group%20to%20have%20security%20group%20as%20a%20group%20owner.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20Juan%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-815899%22%20slang%3D%22en-US%22%3ERe%3A%20Add%20AD%20Security%20group%20as%20Site%20collection%20administrator%20-%20SPO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-815899%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F370801%22%20target%3D%22_blank%22%3E%40jean090681%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECurrently%2C%20there%20is%20no%20way%20to%20have%20the%20Office%20365%20nested%20group%20as%20site%20collection%20admin%2C%20I%20know%20Microsoft%20working%20on%20nested%20AAD%20Group%20but%20there%20is%20no%20timeline%20for%20that.%3C%2FP%3E%3CP%3EBut%20as%20Juan%20said%20you%20can%20have%20your%20current%20security%20group%20as%20site%20collection%20primary%20admin.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-817446%22%20slang%3D%22en-US%22%3ERe%3A%20Add%20AD%20Security%20group%20as%20Site%20collection%20administrator%20-%20SPO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-817446%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3E%26nbsp%3B%20Thank%20you%20so%20much%2C%20this%20is%20exactly%20what%20i%20was%20looking%20for.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
jean090681
Occasional Contributor

Is there a way to add a security group as Primary or secondary site collection administrator to all the sites in the tenant via PowerShell?

 

I know this works for adding a user account to all the sites as SC Admin

 

$Sites = Get-SPOSite -Limit ALL Foreach ($Site in $Sites) { Set-SPOUser -site $Site.Url -LoginName $AdminName -IsSiteCollectionAdmin $True

 

The same command with Set-SPOSiteGroup does not work Set-SPOSiteGroup : A parameter cannot be found that matches parameter name 'IsSiteCollectionAdmin'

Since 'IsSiteCollectionAdmin' is not accepted with Set-SPOSiteGroup

 

Any suggestions on how to set security group as site collection administrator via PS script/ cmdlets

 

Thanks in advance.

4 Replies
Highlighted

@jean090681 

Currently, there is no way to have the Office 365 nested group as site collection admin, I know Microsoft working on nested AAD Group but there is no timeline for that.

But as Juan said you can have your current security group as site collection primary admin.

 

 

Highlighted
Solution
That's not correct...you can add an AD Security Group as site collection admins with no problems and it can be also done through PS: https://kirkbarrett.wordpress.com/2016/04/04/adding-an-o365-security-group-to-the-site-collection-ad...
Highlighted
you right, I thought he is asking for the Office 365 nested group to have security group as a group owner.

Thanks Juan
Highlighted

@Juan Carlos González Martín  Thank you so much, this is exactly what i was looking for.