A commonly posed question within an organisation that use SharePoint Online is "Can I get a list of all the site administrators?". A perfectly reasonable question, I am sure you will agree. Regardless of whether your role is a SharePoint Administrator, Office 365 Administrator or even a PowerShell Developer, you will spot there is more to this request than meets the eye. You will no doubt start googling looking for scripts that get all SharePoint Administrators or all SharePoint Site Owners. Why re-invent the wheel after all.
I found several scripts and blog posts that mostly met my needs. I did feel the need to start from the ground up so this is what I am sharing with you in this post.
Site Administrators or Members with Full Control?
Most administrators will find themselves looking initially at Get-PnPSiteCollectionAdmin, which is an admirable starting point.Read More