SharePoint Online PowerShell Commands
The SharePoint Online Management Shell: sites, sharing and tenant settings.All SharePoint Online PowerShell pages
- Get-SPOSite storage usage: StorageUsageCurrent and StorageQuota for every siteGet-SPOSite -Limit All lists each site's StorageUsageCurrent and StorageQuota in MB. Add -IncludePersonalSite for OneDrive; set quotas with Set-SPOSite.
- Restore-SPODeletedSite: restore a deleted SharePoint Online site with PowerShellDeleted SharePoint Online sites stay 93 days in the recycle bin. Find them with Get-SPODeletedSite and bring one back with Restore-SPODeletedSite -Identity URL.
- Set-SPOSite -LockState: make a SharePoint Online site read-only or block accessSet-SPOSite -Identity URL -LockState ReadOnly makes a SharePoint site read-only, NoAccess blocks it with a 403 or redirect, and Unlock restores normal access.
- Set-SPOUser -IsSiteCollectionAdmin: add a site collection admin in SharePoint Online or OneDriveSet-SPOUser -Site URL -LoginName UPN -IsSiteCollectionAdmin $true makes a user site collection admin of a SharePoint site or OneDrive. It takes a Boolean.