| external help file | Microsoft.Online.SharePoint.PowerShell.dll-Help.xml |
|---|---|
| Module Name | Microsoft.Online.SharePoint.PowerShell |
| online version | https://learn.microsoft.com/powershell/module/microsoft.online.sharepoint.powershell/set-spositearchivestate |
| applicable | SharePoint Online |
| title | Set-SPOSiteArchiveState |
| schema | 2.0.0 |
| author | AdiGanMSFT |
| ms.author | adigan |
| ms.reviewer |
Sets the archived state of the site. Can be used to archive and reactivate sites.
Set-SPOSiteArchiveState [-Identity] <SpoSitePipeBind> [-ArchiveState] <SPOArchiveState> [-NoWait] [-Force]
[-WhatIf] [-Confirm] [<CommonParameters>]
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.
Set-SPOSiteArchiveState https://contoso.sharepoint.com/sites/Marketing -ArchiveState ArchivedThis 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.
Set-SPOSiteArchiveState https://contoso.sharepoint.com/sites/Marketing -ArchiveState ActiveThis 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.
Applicable: SharePoint Online
Sets the archived state of the site. Valid values are Archived, Active.
Type: Microsoft.Online.SharePoint.PowerShell.SPOArchiveState
Parameter Sets: (All)
Aliases:
Accepted values: Archived, Active
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseApplicable: SharePoint Online
Whether to set the site archived state without prompting for confirmation.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseApplicable: SharePoint Online
Identity of the site to archive or reactivate.
Type: Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseApplicable: SharePoint Online
Whether to not wait for the operation to complete.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.