SharePoint / Guide 14

Troubleshooting

Common error messages and what actually fixes them.

On-premises

Symptom Likely cause Fix
The term 'Get-SPSite' is not recognized SharePoint cmdlets not loaded Add-PSSnapin Microsoft.SharePoint.PowerShell, or use SharePoint Management Shell
Cannot access the local farm Account lacks SharePoint_Shell_Access / not elevated Run as administrator; Add-SPShellAdmin (see Getting started, tip 4)
Access denied on a content DB in a script Shell admin granted on config DB only Add-SPShellAdmin -UserName ... -Database $db for each DB
"The attempted operation is prohibited because it exceeds the list view threshold" Query over 5,000 items without an index Index filter/sort columns; use folders or filtered views
Timer jobs stuck / servers out of sync Stale configuration cache Clear the config cache (SharePoint Server tips, tip 10)
Users report an error with a correlation ID Anything Get-SPLogsByCorrelation.ps1 -CorrelationId <id>
Content DB shows NeedsUpgrade = True after patching PSConfig not run, or failed Run PSConfig on each server; then Upgrade-SPContentDatabase
Shell memory keeps growing during a long script Undisposed SPSite/SPWeb Dispose in finally blocks or use Start-SPAssignment
Pages slow to load images, CSS and scripts; high SQL load BLOB cache not enabled Enable it on every web server (see the BLOB cache guide)
Changed image or CSS still shows the old version BLOB cache or browser cache Flush with Set-SPBlobCache.ps1 -Flush; rename updated branding files
First page of the day takes 30+ seconds Application pool recycled overnight, nothing warmed it Schedule Invoke-SPWarmup.ps1 after the recycle (Performance guide)
Event ID 7362 about the object cache super user Portal super user/reader accounts not set Set-SPObjectCacheAccounts.ps1, then iisreset on each web server
Publishing sites return "access denied" to everyone after a change Object cache accounts wrong or missing Check the accounts with Set-SPObjectCacheAccounts.ps1 -WebApplication <url>
Servers show different patch levels in Central Administration PSConfig not run on every server Get-SPPatchStatus.ps1, then Invoke-SPPostPatchConfig.ps1 on the servers behind
Health Analyzer: server not compliant with its role A service was started or stopped by hand Let MinRole fix it, or check with Get-SPServiceMatrix.ps1
Popularity Trends reports are empty Usage data collection off, or search analytics not running Reporting and BI guide, "SharePoint's own analytics"

SharePoint Online

Symptom Likely cause Fix
AADSTS700016 / application not found when running Connect-PnPOnline Using the retired shared PnP app Register your own app and pass -ClientId (Getting started, tip 2)
Connect-SPOService fails in PowerShell 7 Module compatibility Import-Module Microsoft.Online.SharePoint.PowerShell -UseWindowsPowerShell, or use Windows PowerShell 5.1
(429) Too Many Requests / (503) Server Unavailable Throttling Slow down, batch, run off-hours; PnP retries automatically
Access denied on Get-SPOUser for a site Not a site collection admin there Temporarily add yourself with Set-SPOUser -IsSiteCollectionAdmin $true
List view threshold error with Get-PnPListItem No paging Add -PageSize 500
Search doesn't show new columns/content Not crawled yet Request-PnPReIndexList / Request-PnPReIndexWeb
Storage still high after deleting versions/files Items are in the recycle bins Check first- and second-stage recycle bins; they count toward storage

General habits that prevent most problems

  • Run with -WhatIf first, and read what it says it will do.
  • Start a transcript before any change.
  • Test in a non-production site or farm.
  • Change one thing at a time, and write down what you changed.