Forum Discussion

Bhavpreet Bains's avatar
Bhavpreet Bains
Iron Contributor
Oct 09, 2018

onedrive list of admin

Hello,

 

We have a user who was accidentally added as site collection admin to various OneDrive accounts. Is it possible to pull a list of all site collection admin for all OneDrive accounts?

 

I've tried using the following cmdlet on one of the site before creating the full script.

get-spouser -Site "<site url>" | select DisplayName, LoginName, UserType, IsSiteAdmin

 

The above returns all site users with isSiteAdmin as false unless I grant my admin account as site collection admin which is not ideal solution. 

 

Running Get-Sposite returns only primary site collection admin. 

 

Which should be the best way to pull list of all site collection admins?

 

Thank you.

B

Resources