Get All Site Administrators and Owners With Full Control – SharePoint Online PowerShell

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.

Google SharePoint Administrators PowerShell

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

PowerShell SharePoint PnP: Installing SharePoint PNP PowerShell

Open Windows Powershell as Administrator.

Run the following

Install-Module SharepointPNPPowershellOnline

Type A when prompted.

To verify the version installed type the following:

Get-Module SharePointPnPPowerShell* -ListAvailable | Select-Object Name,Version | Sort-Object Version -Descending

Type the following to connect to your SharePoint Online Environment replacing <YourTenant> with your Tenancy alias, e.g alanlearnsstuff12345

Read More