Remove-SPOSiteToFileArchivePolicy

Removes a site from a file archive policy.

Syntax

Default (Default)

Remove-SPOSiteToFileArchivePolicy
    -PolicyId 
    -Site 
    []

Description

This cmdlet removes a site from an existing file archive policy. It removes either an included site from a SelectedSites policy or an excluded site from an AllSites or AllODBSites policy.

Removing an included site means the policy no longer applies to that site. Removing an excluded site means the site is no longer exempt, so the policy applies to it again on future runs.

You can't remove the last remaining site from an active SelectedSites policy, because that would leave the policy active with no sites in scope. Set the policy to Inactive first, or add another site before removing this one.

Note

This cmdlet is part of the file archive policies feature which is currently in preview.

Examples

Example 1

Remove-SPOSiteToFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -Site "https://contoso.sharepoint.com/sites/marketing"

Removes the marketing site from the specified file archive policy.

Parameters

-PolicyId

Specifies the unique identifier (GUID) of the policy to remove the site from.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Site

Specifies the URL of the site to remove from the policy.

Parameter properties

Type:SpoSitePipeBind
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object