From aa395da95f4881a933813fe69e2e6a9deb1eb255 Mon Sep 17 00:00:00 2001 From: HectorRMota Date: Wed, 17 Jun 2026 16:58:23 -0700 Subject: [PATCH 1/2] Add File Archive Policy cmdlet documentation (#1181) * Add auto archive public documentation files * Update cmdlet documentation for File Archive Policies Added, updated, and removed cmdlet documentation for File Archive Policies. * Address PR review feedback for file archive policy cmdlets - Add missing front matter properties (applicable, title, author, ms.author, ms.reviewer) - Use 'This cmdlet...' instead of repeating cmdlet name in descriptions - Remove assumed admin role requirement line - Remove 'PS C:\>' prefix from examples - Use lowercase 'file archive policy' instead of Title Case - Remove (e.g., ...) examples from parameter descriptions - Update CommonParameters with backtick-formatted params and new URL - Move preview note from NOTES to Description using [!NOTE] decorator - Format WhatIf in backticks when referenced in prose Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address remaining review feedback - Use backticks instead of quotes for parameter values in prose (SelectedSites, AllSites, Active, Inactive) - Use [!IMPORTANT] tag for LastAccessDateCriteria July 2025 accuracy note - Move Inactive state note from NOTES section to Description in New-SPOFileArchivePolicy Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Populate RELATED LINKS sections with cross-references to all file archive policy cmdlets Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update PolicyType and State parameter types from String to enums - PolicyType: String -> SPOFileArchivePolicyType (in New-SPO and Set-SPO) - State: String -> SPOFileArchivePolicyState (in Set-SPO) - Updated SYNTAX blocks to match Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Hector Mota Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Add-SPOSiteToFileArchivePolicy.md | 104 +++++++++ .../Get-SPOFileArchivePolicy.md | 96 +++++++++ .../Get-SPOFileArchivePolicyReport.md | 90 ++++++++ .../Get-SPOFileArchivePolicySites.md | 88 ++++++++ .../Microsoft.Online.SharePoint.PowerShell.md | 24 +++ .../New-SPOFileArchivePolicy.md | 173 +++++++++++++++ .../Remove-SPOFileArchivePolicy.md | 145 +++++++++++++ .../Remove-SPOSiteToFileArchivePolicy.md | 104 +++++++++ .../Set-SPOFileArchivePolicy.md | 204 ++++++++++++++++++ 9 files changed, 1028 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..9c6dac7ea --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Add-SPOSiteToFileArchivePolicy.md @@ -0,0 +1,104 @@ +--- +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/add-spositetofilearchivepolicy +applicable: SharePoint Online +title: Add-SPOSiteToFileArchivePolicy +schema: 2.0.0 +author: HectorRMota +ms.author: hemota +ms.reviewer: +--- + +# Add-SPOSiteToFileArchivePolicy + +## SYNOPSIS + +Adds a site to a file archive policy. + +## SYNTAX + +``` +Add-SPOSiteToFileArchivePolicy -PolicyId -Site [] +``` + +## 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 + +```powershell +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. 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`, `-ProgressAction`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Get-SPOFileArchivePolicy](Get-SPOFileArchivePolicy.md) + +[Get-SPOFileArchivePolicyReport](Get-SPOFileArchivePolicyReport.md) + +[Get-SPOFileArchivePolicySites](Get-SPOFileArchivePolicySites.md) + +[New-SPOFileArchivePolicy](New-SPOFileArchivePolicy.md) + +[Remove-SPOFileArchivePolicy](Remove-SPOFileArchivePolicy.md) + +[Remove-SPOSiteToFileArchivePolicy](Remove-SPOSiteToFileArchivePolicy.md) + +[Set-SPOFileArchivePolicy](Set-SPOFileArchivePolicy.md) 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..8ca176cce --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicy.md @@ -0,0 +1,96 @@ +--- +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/get-spofilearchivepolicy +applicable: SharePoint Online +title: Get-SPOFileArchivePolicy +schema: 2.0.0 +author: HectorRMota +ms.author: hemota +ms.reviewer: +--- + +# Get-SPOFileArchivePolicy + +## SYNOPSIS + +Gets one or all file archive policies for the tenant. + +## SYNTAX + +``` +Get-SPOFileArchivePolicy [-PolicyId ] [] +``` + +## DESCRIPTION + +This 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. + +> [!NOTE] +> This cmdlet is part of the file archive policies feature which is currently in preview. + +## EXAMPLES + +### Example 1 + +```powershell +Get-SPOFileArchivePolicy +``` + +Returns all file archive policies configured for the tenant. + +### Example 2 + +```powershell +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`, `-ProgressAction`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-SPOSiteToFileArchivePolicy](Add-SPOSiteToFileArchivePolicy.md) + +[Get-SPOFileArchivePolicyReport](Get-SPOFileArchivePolicyReport.md) + +[Get-SPOFileArchivePolicySites](Get-SPOFileArchivePolicySites.md) + +[New-SPOFileArchivePolicy](New-SPOFileArchivePolicy.md) + +[Remove-SPOFileArchivePolicy](Remove-SPOFileArchivePolicy.md) + +[Remove-SPOSiteToFileArchivePolicy](Remove-SPOSiteToFileArchivePolicy.md) + +[Set-SPOFileArchivePolicy](Set-SPOFileArchivePolicy.md) 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..1eca92790 --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicyReport.md @@ -0,0 +1,90 @@ +--- +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/get-spofilearchivepolicyreport +applicable: SharePoint Online +title: Get-SPOFileArchivePolicyReport +schema: 2.0.0 +author: HectorRMota +ms.author: hemota +ms.reviewer: +--- + +# Get-SPOFileArchivePolicyReport + +## SYNOPSIS + +Gets run reports for a file archive policy. + +## SYNTAX + +``` +Get-SPOFileArchivePolicyReport -PolicyId [] +``` + +## DESCRIPTION + +This 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. + +> [!NOTE] +> This cmdlet is part of the file archive policies feature which is currently in preview. + +## EXAMPLES + +### Example 1 + +```powershell +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`, `-ProgressAction`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-SPOSiteToFileArchivePolicy](Add-SPOSiteToFileArchivePolicy.md) + +[Get-SPOFileArchivePolicy](Get-SPOFileArchivePolicy.md) + +[Get-SPOFileArchivePolicySites](Get-SPOFileArchivePolicySites.md) + +[New-SPOFileArchivePolicy](New-SPOFileArchivePolicy.md) + +[Remove-SPOFileArchivePolicy](Remove-SPOFileArchivePolicy.md) + +[Remove-SPOSiteToFileArchivePolicy](Remove-SPOSiteToFileArchivePolicy.md) + +[Set-SPOFileArchivePolicy](Set-SPOFileArchivePolicy.md) 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..f10a0fa2e --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Get-SPOFileArchivePolicySites.md @@ -0,0 +1,88 @@ +--- +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/get-spofilearchivepolicysites +applicable: SharePoint Online +title: Get-SPOFileArchivePolicySites +schema: 2.0.0 +author: HectorRMota +ms.author: hemota +ms.reviewer: +--- + +# Get-SPOFileArchivePolicySites + +## SYNOPSIS + +Gets the list of sites associated with a file archive policy. + +## SYNTAX + +``` +Get-SPOFileArchivePolicySites -PolicyId [] +``` + +## DESCRIPTION + +This 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`. + +> [!NOTE] +> This cmdlet is part of the file archive policies feature which is currently in preview. + +## EXAMPLES + +### Example 1 + +```powershell +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`, `-ProgressAction`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-SPOSiteToFileArchivePolicy](Add-SPOSiteToFileArchivePolicy.md) + +[Get-SPOFileArchivePolicy](Get-SPOFileArchivePolicy.md) + +[Get-SPOFileArchivePolicyReport](Get-SPOFileArchivePolicyReport.md) + +[New-SPOFileArchivePolicy](New-SPOFileArchivePolicy.md) + +[Remove-SPOFileArchivePolicy](Remove-SPOFileArchivePolicy.md) + +[Remove-SPOSiteToFileArchivePolicy](Remove-SPOSiteToFileArchivePolicy.md) + +[Set-SPOFileArchivePolicy](Set-SPOFileArchivePolicy.md) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Microsoft.Online.SharePoint.PowerShell.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Microsoft.Online.SharePoint.PowerShell.md index 4529951a5..a7f2d6f3d 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Microsoft.Online.SharePoint.PowerShell.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Microsoft.Online.SharePoint.PowerShell.md @@ -65,6 +65,9 @@ Uploads a new site script for use either directly or in a site design. ### [Add-SPOSiteScriptPackage](Add-SPOSiteScriptPackage.md) Uploads a new site script package for use either directly or in a site design. +### [Add-SPOSiteToFileArchivePolicy](Add-SPOSiteToFileArchivePolicy.md) +Adds a site to a File Archive Policy. + ### [Add-SPOTenantCdnOrigin](Add-SPOTenantCdnOrigin.md) Configures a new origin to public or private content delivery network (CDN). Requires Tenant administrator permissions. @@ -209,6 +212,15 @@ This cmdlet enables the administrator to check status of all active and availabl ### [Get-SPOExternalUser](Get-SPOExternalUser.md) Returns external users in the tenant. +### [Get-SPOFileArchivePolicy](Get-SPOFileArchivePolicy.md) +Gets one or all File Archive Policies for the tenant. + +### [Get-SPOFileArchivePolicyReport](Get-SPOFileArchivePolicyReport.md) +Gets run reports for a File Archive Policy. + +### [Get-SPOFileArchivePolicySites](Get-SPOFileArchivePolicySites.md) +Gets the list of sites associated with a File Archive Policy. + ### [Get-SPOFileRequestBrandingProfiles](Get-SPOFileRequestBrandingProfiles.md) Retrieves branding profiles configured for the file request feature, including details about logo and background assets. @@ -464,6 +476,9 @@ Creates a new billing policy for an application owned by the tenant. ### [New-SPOContainerType](New-SPOContainerType.md) This cmdlet creates a new container type of standard or trial status. The standard container type can be created with the regular billing structure or direct to customer billing structure. +### [New-SPOFileArchivePolicy](New-SPOFileArchivePolicy.md) +Creates a new File Archive Policy for the tenant. + ### [New-SPOListFileVersionBatchDeleteJob](New-SPOListFileVersionBatchDeleteJob.md) Queues a job to trim versions from a document library. @@ -542,6 +557,9 @@ Removes a SharePoint Online deleted site collection from the Recycle Bin. ### [Remove-SPOExternalUser](Remove-SPOExternalUser.md) Removes a collection of external users from the tenancy's folder. +### [Remove-SPOFileArchivePolicy](Remove-SPOFileArchivePolicy.md) +Removes (soft-deletes) a File Archive Policy. + ### [Remove-SPOFileRequestBrandingProfile](Remove-SPOFileRequestBrandingProfile.md) Removes a branding profile (either primary or secondary) configured for the file request feature across the tenant. @@ -620,6 +638,9 @@ Stops processing of the in-progress manage version policy job for the given site ### [Remove-SPOSiteScript](Remove-SPOSiteScript.md) Removes a site script. +### [Remove-SPOSiteToFileArchivePolicy](Remove-SPOSiteToFileArchivePolicy.md) +Removes a site from a File Archive Policy. + ### [Remove-SPOSiteUserInvitations](Remove-SPOSiteUserInvitations.md) . @@ -728,6 +749,9 @@ This cmdlet sends a trust request to the tenant with whom you want to establish ### [Set-SPODisableSpacesActivation](Set-SPODisableSpacesActivation.md) Disables the SharePoint Spaces activation. +### [Set-SPOFileArchivePolicy](Set-SPOFileArchivePolicy.md) +Updates an existing File Archive Policy. + ### [Set-SPOFontPackage](Set-SPOFontPackage.md) Applies a brand font package to a SharePoint site or Viva Connections. 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..daa34c51d --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/New-SPOFileArchivePolicy.md @@ -0,0 +1,173 @@ +--- +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/new-spofilearchivepolicy +applicable: SharePoint Online +title: New-SPOFileArchivePolicy +schema: 2.0.0 +author: HectorRMota +ms.author: hemota +ms.reviewer: +--- + +# New-SPOFileArchivePolicy + +## SYNOPSIS + +Creates a new file archive policy for the tenant. + +## SYNTAX + +``` +New-SPOFileArchivePolicy [-Name ] -PolicyType [-LastAccessDateCriteria ] + [-FileTypeCriteria ] [-IsWhatIfMode ] [] +``` + +## DESCRIPTION + +This 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` with `-State Active` before it takes effect. + +> [!NOTE] +> This cmdlet is part of the file archive policies feature which is currently in preview. + +## EXAMPLES + +### Example 1 + +```powershell +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 +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 +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. 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. + +> [!IMPORTANT] +> 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: SPOFileArchivePolicyType +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`, `-ProgressAction`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-SPOSiteToFileArchivePolicy](Add-SPOSiteToFileArchivePolicy.md) + +[Get-SPOFileArchivePolicy](Get-SPOFileArchivePolicy.md) + +[Get-SPOFileArchivePolicyReport](Get-SPOFileArchivePolicyReport.md) + +[Get-SPOFileArchivePolicySites](Get-SPOFileArchivePolicySites.md) + +[Remove-SPOFileArchivePolicy](Remove-SPOFileArchivePolicy.md) + +[Remove-SPOSiteToFileArchivePolicy](Remove-SPOSiteToFileArchivePolicy.md) + +[Set-SPOFileArchivePolicy](Set-SPOFileArchivePolicy.md) 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..a99059774 --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Remove-SPOFileArchivePolicy.md @@ -0,0 +1,145 @@ +--- +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/remove-spofilearchivepolicy +applicable: SharePoint Online +title: Remove-SPOFileArchivePolicy +schema: 2.0.0 +author: HectorRMota +ms.author: hemota +ms.reviewer: +--- + +# Remove-SPOFileArchivePolicy + +## SYNOPSIS + +Removes (soft-deletes) a file archive policy. + +## SYNTAX + +``` +Remove-SPOFileArchivePolicy -PolicyId [-Force] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION + +This 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. + +> [!NOTE] +> This cmdlet is part of the file archive policies feature which is currently in preview. + +## EXAMPLES + +### Example 1 + +```powershell +Remove-SPOFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +``` + +Removes the specified file archive policy after prompting for confirmation. + +### Example 2 + +```powershell +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`, `-ProgressAction`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-SPOSiteToFileArchivePolicy](Add-SPOSiteToFileArchivePolicy.md) + +[Get-SPOFileArchivePolicy](Get-SPOFileArchivePolicy.md) + +[Get-SPOFileArchivePolicyReport](Get-SPOFileArchivePolicyReport.md) + +[Get-SPOFileArchivePolicySites](Get-SPOFileArchivePolicySites.md) + +[New-SPOFileArchivePolicy](New-SPOFileArchivePolicy.md) + +[Remove-SPOSiteToFileArchivePolicy](Remove-SPOSiteToFileArchivePolicy.md) + +[Set-SPOFileArchivePolicy](Set-SPOFileArchivePolicy.md) 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..39f4a82e9 --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Remove-SPOSiteToFileArchivePolicy.md @@ -0,0 +1,104 @@ +--- +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/remove-spositetofilearchivepolicy +applicable: SharePoint Online +title: Remove-SPOSiteToFileArchivePolicy +schema: 2.0.0 +author: HectorRMota +ms.author: hemota +ms.reviewer: +--- + +# Remove-SPOSiteToFileArchivePolicy + +## SYNOPSIS + +Removes a site from a file archive policy. + +## SYNTAX + +``` +Remove-SPOSiteToFileArchivePolicy -PolicyId -Site [] +``` + +## DESCRIPTION + +This cmdlet removes a site from an existing file archive policy. The site will no longer be included in future policy runs. + +> [!NOTE] +> This cmdlet is part of the file archive policies feature which is currently in preview. + +## EXAMPLES + +### Example 1 + +```powershell +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. + +```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`, `-ProgressAction`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-SPOSiteToFileArchivePolicy](Add-SPOSiteToFileArchivePolicy.md) + +[Get-SPOFileArchivePolicy](Get-SPOFileArchivePolicy.md) + +[Get-SPOFileArchivePolicyReport](Get-SPOFileArchivePolicyReport.md) + +[Get-SPOFileArchivePolicySites](Get-SPOFileArchivePolicySites.md) + +[New-SPOFileArchivePolicy](New-SPOFileArchivePolicy.md) + +[Remove-SPOFileArchivePolicy](Remove-SPOFileArchivePolicy.md) + +[Set-SPOFileArchivePolicy](Set-SPOFileArchivePolicy.md) 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..e02a53161 --- /dev/null +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOFileArchivePolicy.md @@ -0,0 +1,204 @@ +--- +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-spofilearchivepolicy +applicable: SharePoint Online +title: Set-SPOFileArchivePolicy +schema: 2.0.0 +author: HectorRMota +ms.author: hemota +ms.reviewer: +--- + +# Set-SPOFileArchivePolicy + +## SYNOPSIS + +Updates an existing file archive policy. + +## SYNTAX + +``` +Set-SPOFileArchivePolicy -PolicyId [-Name ] [-PolicyType ] + [-LastAccessDateCriteria ] [-FileTypeCriteria ] [-IsWhatIfMode ] [-State ] + [] +``` + +## DESCRIPTION + +This 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`. + +> [!NOTE] +> This cmdlet is part of the file archive policies feature which is currently in preview. + +## EXAMPLES + +### Example 1 + +```powershell +Set-SPOFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -State "Active" +``` + +Activates the specified file archive policy. + +### Example 2 + +```powershell +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 +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. 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: SPOFileArchivePolicyType +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: SPOFileArchivePolicyState +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`, `-ProgressAction`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-SPOSiteToFileArchivePolicy](Add-SPOSiteToFileArchivePolicy.md) + +[Get-SPOFileArchivePolicy](Get-SPOFileArchivePolicy.md) + +[Get-SPOFileArchivePolicyReport](Get-SPOFileArchivePolicyReport.md) + +[Get-SPOFileArchivePolicySites](Get-SPOFileArchivePolicySites.md) + +[New-SPOFileArchivePolicy](New-SPOFileArchivePolicy.md) + +[Remove-SPOFileArchivePolicy](Remove-SPOFileArchivePolicy.md) + +[Remove-SPOSiteToFileArchivePolicy](Remove-SPOSiteToFileArchivePolicy.md) From 2ed2562f3d21086b2da8ddf9be84a7fd34501dbc Mon Sep 17 00:00:00 2001 From: kgunda1997 Date: Wed, 17 Jun 2026 17:29:28 -0700 Subject: [PATCH 2/2] Add PolicyName parameter to Start-SPORestrictedAccessForSitesInsights (#1182) * Add -PolicyName parameter to Start-SPORestrictedAccessForSitesInsights * Fixing format issues * Addressing Format --------- Co-authored-by: Ruchika Mittal --- ...art-SPORestrictedAccessForSitesInsights.md | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Start-SPORestrictedAccessForSitesInsights.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Start-SPORestrictedAccessForSitesInsights.md index 36be17c19..1bc6ab247 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Start-SPORestrictedAccessForSitesInsights.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Start-SPORestrictedAccessForSitesInsights.md @@ -15,18 +15,18 @@ manager: ## SYNOPSIS -This cmdlet enables administrator to trigger the build of a new restricted access control insights report for the data from last 28 days. +This cmdlet starts the generation of a new restricted access control insights report based on data from the previous 28 days. ## SYNTAX ``` -Start-SPORestrictedAccessForSitesInsights [-RACProtectedSites] [-ActionsBlockedByPolicy] [-Force] [-WhatIf] - [-Confirm] [] +Start-SPORestrictedAccessForSitesInsights [-RACProtectedSites] [-ActionsBlockedByPolicy] [-Force] + [-PolicyName ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -After this cmdlet is executed, the restricted access control insights report generation request is initiated for the requested report subtype. | + This cmdlet enables administrator to trigger the build of a new restricted access control insights report for the data from last 28 days. ## EXAMPLES @@ -102,6 +102,24 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PolicyName + +> Applicable: SharePoint Online + +It is an optional parameter, used together with `-ActionsBlockedByPolicy`, that scopes the report to a single policy. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet.