Add-SPOSiteToFileArchivePolicy

Adds a site to a file archive policy.

Syntax

Default (Default)

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

Description

This cmdlet adds a site to an existing file archive policy that has a PolicyType of SelectedSites. The site must exist and be eligible for archiving. At least one site must be added before a SelectedSites policy can be activated.

Note

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

Examples

Example 1

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

Adds the marketing site to the specified file archive policy.

Parameters

-PolicyId

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

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 add to the policy. The site must exist and be eligible for archiving.

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