From 3b65d88640a81b7435355d64f30fdc34a9d6918a Mon Sep 17 00:00:00 2001 From: HectorRMota Date: Tue, 16 Jun 2026 16:07:46 -0700 Subject: [PATCH] Add auto archive public documentation files --- .../Add-SPOSiteToFileArchivePolicy.md | 79 ++++++++ .../Get-SPOFileArchivePolicy.md | 71 ++++++++ .../Get-SPOFileArchivePolicyReport.md | 66 +++++++ .../Get-SPOFileArchivePolicySites.md | 64 +++++++ .../New-SPOFileArchivePolicy.md | 140 ++++++++++++++ .../Remove-SPOFileArchivePolicy.md | 117 ++++++++++++ .../Remove-SPOSiteToFileArchivePolicy.md | 79 ++++++++ .../Set-SPOFileArchivePolicy.md | 172 ++++++++++++++++++ 8 files changed, 788 insertions(+) create mode 100644 sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOSiteToFileArchivePolicy.md create mode 100644 sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicy.md create mode 100644 sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicyReport.md create mode 100644 sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicySites.md create mode 100644 sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/New-SPOFileArchivePolicy.md create mode 100644 sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Remove-SPOFileArchivePolicy.md create mode 100644 sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Remove-SPOSiteToFileArchivePolicy.md create mode 100644 sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOFileArchivePolicy.md diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOSiteToFileArchivePolicy.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOSiteToFileArchivePolicy.md new file mode 100644 index 000000000..c9cd9b1cd --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOSiteToFileArchivePolicy.md @@ -0,0 +1,79 @@ +--- +external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml +Module Name: Microsoft.Online.SharePoint.PowerShell +online version: +schema: 2.0.0 +--- + +# Add-SPOSiteToFileArchivePolicy + +## SYNOPSIS +Adds a site to a File Archive Policy. + +## SYNTAX + +``` +Add-SPOSiteToFileArchivePolicy -PolicyId -Site [] +``` + +## DESCRIPTION +The `Add-SPOSiteToFileArchivePolicy` 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. + +You must be a SharePoint Administrator or Global Administrator to run this cmdlet. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> 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. + +```yaml +Type: Guid +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Site +Specifies the URL of the site to add to the policy (e.g., "https://contoso.sharepoint.com/sites/marketing"). The site must exist and be eligible for archiving. + +```yaml +Type: SpoSitePipeBind +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +This cmdlet is part of the File Archive Policies feature which is currently in preview. + +## RELATED LINKS diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicy.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicy.md new file mode 100644 index 000000000..999cf0913 --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicy.md @@ -0,0 +1,71 @@ +--- +external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml +Module Name: Microsoft.Online.SharePoint.PowerShell +online version: +schema: 2.0.0 +--- + +# Get-SPOFileArchivePolicy + +## SYNOPSIS +Gets one or all File Archive Policies for the tenant. + +## SYNTAX + +``` +Get-SPOFileArchivePolicy [-PolicyId ] [] +``` + +## DESCRIPTION +The `Get-SPOFileArchivePolicy` cmdlet retrieves the properties of File Archive Policies for the connected SharePoint Online tenant. If the `-PolicyId` parameter is specified, returns only the matching policy. If omitted, returns all File Archive Policies under the tenant. + +You must be a SharePoint Administrator or Global Administrator to run this cmdlet. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-SPOFileArchivePolicy +``` + +Returns all File Archive Policies configured for the tenant. + +### Example 2 +```powershell +PS C:\> Get-SPOFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +``` + +Returns the File Archive Policy with the specified ID. + +## PARAMETERS + +### -PolicyId +Specifies the unique identifier (GUID) of the policy to retrieve. If not specified, all policies under the tenant are returned. + +```yaml +Type: Guid +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +This cmdlet is part of the File Archive Policies feature which is currently in preview. + +## RELATED LINKS diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicyReport.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicyReport.md new file mode 100644 index 000000000..21e758764 --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicyReport.md @@ -0,0 +1,66 @@ +--- +external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml +Module Name: Microsoft.Online.SharePoint.PowerShell +online version: +schema: 2.0.0 +--- + +# Get-SPOFileArchivePolicyReport + +## SYNOPSIS +Gets run reports for a File Archive Policy. + +## SYNTAX + +``` +Get-SPOFileArchivePolicyReport -PolicyId [] +``` + +## DESCRIPTION +The `Get-SPOFileArchivePolicyReport` cmdlet retrieves the run reports for a File Archive Policy. Reports are kept for the past 12 months and include details about each policy run such as how many sites were processed, how many files were archived, and the total storage archived. + +For policies running in WhatIf mode, reports show how many files and how much storage would have been archived instead. + +You must be a SharePoint Administrator or Global Administrator to run this cmdlet. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-SPOFileArchivePolicyReport -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +``` + +Returns all run reports for the specified File Archive Policy from the past 12 months. + +## PARAMETERS + +### -PolicyId +Specifies the unique identifier (GUID) of the policy to retrieve run reports for. + +```yaml +Type: Guid +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +This cmdlet is part of the File Archive Policies feature which is currently in preview. + +## RELATED LINKS diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicySites.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicySites.md new file mode 100644 index 000000000..7491fc47a --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicySites.md @@ -0,0 +1,64 @@ +--- +external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml +Module Name: Microsoft.Online.SharePoint.PowerShell +online version: +schema: 2.0.0 +--- + +# Get-SPOFileArchivePolicySites + +## SYNOPSIS +Gets the list of sites associated with a File Archive Policy. + +## SYNTAX + +``` +Get-SPOFileArchivePolicySites -PolicyId [] +``` + +## DESCRIPTION +The `Get-SPOFileArchivePolicySites` cmdlet retrieves the list of sites that have been added to a File Archive Policy. This is applicable to policies with a PolicyType of "SelectedSites". + +You must be a SharePoint Administrator or Global Administrator to run this cmdlet. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-SPOFileArchivePolicySites -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +``` + +Returns all sites associated with the specified File Archive Policy. + +## PARAMETERS + +### -PolicyId +Specifies the unique identifier (GUID) of the policy to retrieve the site list for. + +```yaml +Type: Guid +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +This cmdlet is part of the File Archive Policies feature which is currently in preview. + +## RELATED LINKS diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/New-SPOFileArchivePolicy.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/New-SPOFileArchivePolicy.md new file mode 100644 index 000000000..a8eb87636 --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/New-SPOFileArchivePolicy.md @@ -0,0 +1,140 @@ +--- +external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml +Module Name: Microsoft.Online.SharePoint.PowerShell +online version: +schema: 2.0.0 +--- + +# New-SPOFileArchivePolicy + +## SYNOPSIS +Creates a new File Archive Policy for the tenant. + +## SYNTAX + +``` +New-SPOFileArchivePolicy [-Name ] -PolicyType [-LastAccessDateCriteria ] + [-FileTypeCriteria ] [-IsWhatIfMode ] [] +``` + +## DESCRIPTION +The `New-SPOFileArchivePolicy` cmdlet creates a new File Archive Policy for the connected SharePoint Online tenant. A File Archive Policy defines the criteria under which files are automatically archived based on their last access date. The policy is created in an Inactive state and must be activated using `Set-SPOFileArchivePolicy` before it takes effect. + +You must be a SharePoint Administrator or Global Administrator to run this cmdlet. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> New-SPOFileArchivePolicy -PolicyType "AllSites" -Name "ArchiveAll" +``` + +Creates a new File Archive Policy named "ArchiveAll" that targets all sites in the tenant, using the default last access date criteria of 24 months. + +### Example 2 +```powershell +PS C:\> New-SPOFileArchivePolicy -PolicyType "SelectedSites" -Name "ArchiveMarketing" -LastAccessDateCriteria 12 -FileTypeCriteria ".docx", ".pptx", ".xlsx" +``` + +Creates a new File Archive Policy named "ArchiveMarketing" that targets selected sites, archives files not accessed in the last 12 months, and only applies to .docx, .pptx, and .xlsx file types. + +### Example 3 +```powershell +PS C:\> New-SPOFileArchivePolicy -PolicyType "AllSites" -IsWhatIfMode $true +``` + +Creates a new File Archive Policy in WhatIf mode. When the policy runs, it will report which files would be archived without actually archiving them. + +## PARAMETERS + +### -FileTypeCriteria +Specifies an array of file extensions to include in the policy. Only files matching the specified extensions will be considered for archiving. Use the dot-prefixed format (e.g., ".docx", ".pdf"). If not specified, all file types are included. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IsWhatIfMode +Specifies whether the policy runs in WhatIf mode. When set to `$true`, the policy will evaluate which files meet the archiving criteria and report the results, but will not actually archive any files. When set to `$false` or not specified, the policy archives files normally when active. + +```yaml +Type: Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LastAccessDateCriteria +Specifies the number of months since a file was last accessed before it becomes eligible for archiving. Valid values range from 6 to 48. The default value is 24 months. Note: the last access date is accurate starting July 2025. Dates before that may be missing access signals from some clients. For critical data, ensure your criteria doesn't archive based on last access dates before July 2025. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Specifies a display name for the policy. If not specified, defaults to "MyPolicy". + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PolicyType +Specifies whether the policy targets all sites in the tenant or only selected sites. Accepted values are "AllSites" and "SelectedSites". If "SelectedSites" is chosen, you must add at least one site using `Add-SPOSiteToFileArchivePolicy` before the policy can be activated. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: AllSites, SelectedSites + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +This cmdlet is part of the File Archive Policies feature which is currently in preview. The policy is created in an Inactive state. Use `Set-SPOFileArchivePolicy` with `-State Active` to activate it. + +## RELATED LINKS diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Remove-SPOFileArchivePolicy.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Remove-SPOFileArchivePolicy.md new file mode 100644 index 000000000..b93089c0d --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Remove-SPOFileArchivePolicy.md @@ -0,0 +1,117 @@ +--- +external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml +Module Name: Microsoft.Online.SharePoint.PowerShell +online version: +schema: 2.0.0 +--- + +# Remove-SPOFileArchivePolicy + +## SYNOPSIS +Removes (soft-deletes) a File Archive Policy. + +## SYNTAX + +``` +Remove-SPOFileArchivePolicy -PolicyId [-Force] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The `Remove-SPOFileArchivePolicy` cmdlet soft-deletes a File Archive Policy by setting its state to Deleted. The policy will no longer run after being removed. By default, the cmdlet prompts for confirmation before proceeding. Use the `-Force` parameter to bypass the confirmation prompt. + +You must be a SharePoint Administrator or Global Administrator to run this cmdlet. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Remove-SPOFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +``` + +Removes the specified File Archive Policy after prompting for confirmation. + +### Example 2 +```powershell +PS C:\> Remove-SPOFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -Force +``` + +Removes the specified File Archive Policy without prompting for confirmation. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +Bypasses the confirmation prompt and removes the policy immediately. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PolicyId +Specifies the unique identifier (GUID) of the policy to remove. + +```yaml +Type: Guid +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +This cmdlet is part of the File Archive Policies feature which is currently in preview. + +## RELATED LINKS diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Remove-SPOSiteToFileArchivePolicy.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Remove-SPOSiteToFileArchivePolicy.md new file mode 100644 index 000000000..43178e04e --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Remove-SPOSiteToFileArchivePolicy.md @@ -0,0 +1,79 @@ +--- +external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml +Module Name: Microsoft.Online.SharePoint.PowerShell +online version: +schema: 2.0.0 +--- + +# Remove-SPOSiteToFileArchivePolicy + +## SYNOPSIS +Removes a site from a File Archive Policy. + +## SYNTAX + +``` +Remove-SPOSiteToFileArchivePolicy -PolicyId -Site [] +``` + +## DESCRIPTION +The `Remove-SPOSiteToFileArchivePolicy` cmdlet removes a site from an existing File Archive Policy. The site will no longer be included in future policy runs. + +You must be a SharePoint Administrator or Global Administrator to run this cmdlet. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> 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. + +```yaml +Type: Guid +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Site +Specifies the URL of the site to remove from the policy (e.g., "https://contoso.sharepoint.com/sites/marketing"). + +```yaml +Type: SpoSitePipeBind +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +This cmdlet is part of the File Archive Policies feature which is currently in preview. + +## RELATED LINKS diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOFileArchivePolicy.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOFileArchivePolicy.md new file mode 100644 index 000000000..c361c8f8d --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOFileArchivePolicy.md @@ -0,0 +1,172 @@ +--- +external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml +Module Name: Microsoft.Online.SharePoint.PowerShell +online version: +schema: 2.0.0 +--- + +# Set-SPOFileArchivePolicy + +## SYNOPSIS +Updates an existing File Archive Policy. + +## SYNTAX + +``` +Set-SPOFileArchivePolicy -PolicyId [-Name ] [-PolicyType ] + [-LastAccessDateCriteria ] [-FileTypeCriteria ] [-IsWhatIfMode ] [-State ] + [] +``` + +## DESCRIPTION +The `Set-SPOFileArchivePolicy` cmdlet updates the properties of an existing File Archive Policy. Only the parameters that are specified will be updated; all other properties remain unchanged. You cannot set the State to "Active" unless the PolicyType is "AllSites" or at least one site has been added to the policy using `Add-SPOSiteToFileArchivePolicy`. + +You must be a SharePoint Administrator or Global Administrator to run this cmdlet. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Set-SPOFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -State "Active" +``` + +Activates the specified File Archive Policy. + +### Example 2 +```powershell +PS C:\> Set-SPOFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -Name "Updated Policy Name" -LastAccessDateCriteria 12 +``` + +Updates the display name and changes the last access date criteria to 12 months for the specified policy. + +### Example 3 +```powershell +PS C:\> Set-SPOFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -IsWhatIfMode $true +``` + +Enables WhatIf mode on the specified policy. Future policy runs will report eligible files without archiving them. + +## PARAMETERS + +### -FileTypeCriteria +Specifies an updated array of file extensions to include in the policy. Only files matching the specified extensions will be considered for archiving. Use the dot-prefixed format (e.g., ".docx", ".pdf"). Set to `$null` to include all file types. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IsWhatIfMode +Specifies whether the policy runs in WhatIf mode. When set to `$true`, the policy will evaluate which files meet the archiving criteria and report the results, but will not actually archive any files. When set to `$false`, the policy archives files normally when active. + +```yaml +Type: Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LastAccessDateCriteria +Specifies the updated number of months since a file was last accessed before it becomes eligible for archiving. Valid values range from 6 to 48. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Specifies an updated display name for the policy. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PolicyId +Specifies the unique identifier (GUID) of the policy to update. + +```yaml +Type: Guid +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PolicyType +Specifies the updated policy type. Accepted values are "AllSites" (targets all sites in the tenant) and "SelectedSites" (targets only sites explicitly added to the policy). + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: AllSites, SelectedSites + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -State +Specifies the updated state of the policy. Accepted values are "Active" and "Inactive". A policy cannot be set to "Active" unless its PolicyType is "AllSites" or at least one site has been added to it. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: Active, Inactive + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +This cmdlet is part of the File Archive Policies feature which is currently in preview. + +## RELATED LINKS