Edit

Share via


Set-SPOSiteArchiveState

Sets the archived state of the site. Can be used to archive and reactivate sites.

Syntax

Default (Default)

Set-SPOSiteArchiveState
    [-Identity] <SpoSitePipeBind>
    [-ArchiveState] <SPOArchiveState>
    [-NoWait]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use this cmdlet to change the archive status of the site. You must be at least a SharePoint Online administrator and be a site collection administrator to run the cmdlet. Microsoft 365 Archive needs to be enabled for the organization to be able to use the feature.

Examples

Example 1

Set-SPOSiteArchiveState https://contoso.sharepoint.com/sites/Marketing -ArchiveState Archived

This example marks the site as Archived. For seven days after the operation, the site will remain in a "RecentlyArchived" state, where any reactivations will be free and instantaneous. If a site is reactivated after seven days, any reactivations will be charged and will take time.

Example 2

Set-SPOSiteArchiveState https://contoso.sharepoint.com/sites/Marketing -ArchiveState Active

This example triggers the reactivation of a site. If the site is reactivated from the "RecentlyArchived" state, it will become available instantaneously. If the site is reactivated from the "FullyArchived" state, it may take time for it to be reactivated.

Parameters

-ArchiveState

Applicable: SharePoint Online

Sets the archived state of the site. Valid values are Archived, Active.

Parameter properties

Type:Microsoft.Online.SharePoint.PowerShell.SPOArchiveState
Default value:None
Accepted values:Archived, Active
Supports wildcards:False
DontShow:False

Parameter sets

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

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

-Force

{{ Fill Force Description }}

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-Identity

{{ Fill Identity Description }}

Parameter properties

Type:Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-NoWait

{{ Fill NoWait Description }}

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
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

Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind

Outputs

System.Object