Notes / SharePoint / Scripts
Scripts
SharePoint Server, SharePoint Online and migration PowerShell scripts with documentation and safe-use guidance.
Scripts
Every script has built-in help (Get-Help .\Script.ps1 -Full). Reports are read-only; scripts that change data support -WhatIf.
SharePoint Server
Run on a farm server from the SharePoint Management Shell.
- Get-SPFarmInventory
Builds a CSV inventory of a SharePoint Server farm.
- Get-SPLargeLists
Finds lists and libraries that are approaching or over the list view threshold.
- Get-SPLogsByCorrelation
Collects ULS log entries for a correlation ID from the whole farm.
- Get-SPPatchStatus
Verifies that every server in the farm is on the same SharePoint build after patching.
- Get-SPServiceMatrix
Shows which SharePoint services run on which servers, as a matrix.
- Get-SPSiteStorageReport
Reports storage, quota use and staleness for every site collection.
- Invoke-SPPostPatchConfig
Runs the SharePoint configuration step (PSConfig) on this server after installing an update.
- Invoke-SPWarmup
Warms up SharePoint web applications by requesting their pages after an app pool recycle.
- Set-SPBlobCache
Shows, enables, disables or flushes the BLOB cache for a web application.
- Set-SPObjectCacheAccounts
Shows or sets the object cache super user and super reader accounts for a web application.
- Test-SPUpgradeReadiness
Runs Test-SPContentDatabase and produces one readable report for upgrade planning.
SharePoint Online
Run from any workstation with the SPO module or PnP.PowerShell.
- Get-SPOExternalUsersReport
Lists guest (external) users on every SharePoint Online site that allows sharing.
- Get-SPOListsNearThreshold
Finds large lists and libraries in a SharePoint Online site and shows their indexes.
- Get-SPOSiteInventory
Tenant-wide SharePoint Online site inventory: storage, sharing, staleness, hubs.
- Get-SPOUniquePermissions
Reports where permission inheritance is broken in a SharePoint Online site.
- Remove-SPOOldFileVersions
Trims old file versions in a document library, keeping the newest N versions.
- Restore-SPORecycleBinByUser
Restores items that one user deleted in a time window (mass-deletion recovery).
Migration
Pre-migration checks that run anywhere PowerShell can read the source.
- Find-MigrationBlockers
Scans a file share (or any folder) for problems that block or complicate a move to SharePoint Online / OneDrive.