Commands › SharePoint Online

Add-SPOSiteToFileArchivePolicy

SharePoint Online Microsoft.Online.SharePoint.PowerShell Add-*

Adds a site to a file archive policy.

Quick start script

# Add-SPOSiteToFileArchivePolicy — 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
Add-SPOSiteToFileArchivePolicy -PolicyId <Guid> -Site <SpoSitePipeBind> | Format-List

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

Syntax

Add-SPOSiteToFileArchivePolicy -PolicyId <Guid> -Site <SpoSitePipeBind> [<CommonParameters>]

Parameters (2)

ParameterTypeRequiredWhat it controls
-PolicyId Guid yes Specifies the unique identifier (GUID) of the policy to add the site to.
-Site SpoSitePipeBind yes Specifies the URL of the site to add to the policy. The site must exist and be eligible for archiving.

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