Commands › SharePoint Online

Repair-SPOSite

SharePoint Online Microsoft.Online.SharePoint.PowerShell Repair-*

Checks and repairs the site collection and its contents.

Quick start script

# Repair-SPOSite — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Run and inspect
Repair-SPOSite -Identity <SpoSitePipeBind> | Format-List

# 3. Export for evidence / drift tracking
Repair-SPOSite | Export-Clixml .\SPOSite-$(Get-Date -Format yyyyMMdd).xml

Syntax

Repair-SPOSite -Identity <SpoSitePipeBind> [-RuleId <Guid>] [-RunAlways] [-WhatIf] [-Confirm]
 [<CommonParameters>]

Parameters (5)

ParameterTypeRequiredWhat it controls
-Identity SpoSitePipeBind yes Specifies the SharePoint Online site collection on which to run the repairs.
-RuleId Guid Specifies a health check rule to run.
-RunAlways SwitchParameter Displays a message that explains the effect of the command instead of executing the command.
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.