PowerShell Genie

Microsoft.Online.SharePoint.PowerShell module: setup and commands

Module 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Connect to the SharePoint Online admin service, inventory sites with Get-SPOSite and verify tenant permissions before changing site settings.

Getting it

Install-PSResource -Name Microsoft.Online.SharePoint.PowerShell from the PowerShell Gallery, then connect with Connect-SPOService -Url https://<tenant>-admin.sharepoint.com.

Examples

1PS> Get-SPOSite -Limit 100
Show reference output
1 Url Owner StorageUsageCurrent
2 --- ----- -------------------
3 https://contoso.sharepoint.com/sites/IT admin@contoso.com 1280
1PS> Get-SPOExternalUser -PageSize 50
Show reference output
1 Email DisplayName AcceptedAs
2 ----- ----------- ----------
3 guest@example.test Sample Guest guest@example.test

What it is for

Use it for site inventory, storage reporting, and tenant sharing policy checks. It is also where a site quota or sharing capability gets changed across many sites at once.

Typical tasks

  • Inventory site collections with storage used
  • Find sites with external sharing enabled
  • Report site owners and administrators
  • List external users across the tenant
  • Adjust the storage quota on a site
  • Identify sites with no recent activity

Check the installed version

1PS> Get-Module -ListAvailable Microsoft.Online.SharePoint.PowerShell | Select-Object Name, Version, Path
2PS> Get-Command -Module Microsoft.Online.SharePoint.PowerShell

Compare the module path and version with the session used by your scheduled task or automation account. Use it for site inventory, storage reporting, and tenant sharing policy checks. It is also where a site quota or sharing capability gets changed across many sites at once.

Primary documentation

Microsoft 365, Entra and Azure documentation

Continue
Genie guideMicrosoft.Online.SharePoint.PowerShell module: setup and commands

Connect to the SharePoint Online admin service, inventory sites with Get-SPOSite and verify tenant permissions before changing site settings.