SharePoint file archive policy: how it works
Microsoft's SharePoint file archive policy archives files automatically once nobody has accessed them for a set number of months. You create it with the New-SPOFileArchivePolicy PowerShell cmdlet, test it in What-If mode, and switch it on with Set-SPOFileArchivePolicy -State Active. Microsoft's reference pages mark the whole feature as currently in preview.
This page walks through the cmdlets in the order you would use them, what each rule means, what happens to a file after the policy archives it, and what Microsoft has not documented yet. Everything here comes from Microsoft Learn's cmdlet reference and its Microsoft 365 Archive pages. Where a point is not documented, the page says so.
Status: preview, no release date published
The cmdlet pages carry the note "This cmdlet is part of the file archive policies feature which is currently in preview." In the documentation we checked, Microsoft gives no general availability date and no schedule for how often a policy runs. Microsoft's Archive overview does call these "SharePoint Advanced Management (SAM) automatic file archive policies", which brings SAM licensing into play. See Licensing and cost below, and do not build a plan around the unpublished items.
The cmdlets
| Cmdlet | What it does |
|---|---|
New-SPOFileArchivePolicy | Creates a policy. It is created inactive. |
Set-SPOFileArchivePolicy | Updates a policy and activates or deactivates it with -State. |
Add-SPOSiteToFileArchivePolicy | Adds a site to a policy, as an inclusion or (with -Exclude) an exclusion. |
Get-SPOFileArchivePolicyReport | Returns the run reports for a policy. |
Microsoft also documents Get-SPOFileArchivePolicy, Get-SPOFileArchivePolicySites, Remove-SPOFileArchivePolicy and Remove-SPOSiteToFileArchivePolicy.
Step 1: create the policy
-PolicyType is the only required parameter, and it sets the scope:
| PolicyType | Applies to |
|---|---|
AllSites | All SharePoint sites in the tenant |
AllODBSites | All OneDrive for Business sites in the tenant |
SelectedSites | Only the sites you add to the policy |
New-SPOFileArchivePolicy -PolicyType "AllSites" -Name "ArchiveAll"
That example uses the default rule: archive files not accessed in the last 24 months. To change it, pass -LastAccessDateCriteria, which accepts 6 to 48 months:
New-SPOFileArchivePolicy -PolicyType "SelectedSites" -Name "ArchiveMarketing" -LastAccessDateCriteria 12
-FileTypeCriteria limits the policy to listed extensions, and -FileTypeExclusionCriteria exempts listed extensions. Both take dot-prefixed values such as .docx. If you omit them, all file types are included.
Read the last-access warning before you choose a number. Microsoft states: "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." A file that looks untouched may simply have been opened from a client that did not record the access.
Step 2: add or exclude sites
Inclusion and exclusion work in opposite directions, and using the wrong one returns an error:
- For a
SelectedSitespolicy, add sites as inclusions. At least one site must be added before the policy can be activated. - For an
AllSitesorAllODBSitespolicy, add sites with-Excludeto exempt them. - A single policy holds at most 1,000 sites, counting inclusions and exclusions together.
Add-SPOSiteToFileArchivePolicy -PolicyId "<policy GUID>" -Site "https://contoso.sharepoint.com/sites/marketing"
Add-SPOSiteToFileArchivePolicy -PolicyId "<policy GUID>" -Site "https://contoso.sharepoint.com/sites/legal" -Exclude
The second line only works on an AllSites or AllODBSites policy. The site must exist and be eligible for archiving.
Step 3: test in What-If mode
Create the policy with -IsWhatIfMode $true, or turn it on later with Set-SPOFileArchivePolicy -PolicyId <GUID> -IsWhatIfMode $true. Microsoft describes the behavior: the policy "will evaluate which files meet the archiving criteria and report the results, but will not actually archive any files."
Read the results with:
Get-SPOFileArchivePolicyReport -PolicyId "<policy GUID>"
Reports are kept for the past 12 months and show, for each run, how many sites were processed, how many files were archived and the total storage archived. For a What-If policy they show how many files and how much storage would have been archived. Use those numbers to check the rule before it moves anything.
Step 4: activate
Set-SPOFileArchivePolicy -PolicyId "<policy GUID>" -State Active
You cannot activate a policy unless its type is AllSites or AllODBSites, or at least one site has been added to it. To turn What-If off at the same time, set -IsWhatIfMode $false; Microsoft notes that when it is false the policy "archives files normally when active."
Set-SPOFileArchivePolicy only changes the parameters you pass. Name, criteria, type and What-If mode can all be changed later, with -PolicyId as the only required parameter.
What happens to a file the policy archives
The policy uses the same archive tier as manual file-level archive in Microsoft 365 Archive, so the same behavior applies:
- The file stays in SharePoint, in the archive tier. Anyone with read access can reactivate it, and Microsoft states there is no fee to reactivate an archived file.
- A 120-day wait follows reactivation. Microsoft's management page says a reactivated file cannot be archived "manually or by policy" for 120 days. After that, a policy can archive it again the next time the policy evaluates it, if it still meets the criteria.
- Copilot does not use archived content. Microsoft's FAQ states: "No, archived content isn't used by Microsoft Copilot."
- Site storage figures. Microsoft's FAQ says file-level archive "doesn't change site storage usage or quota behavior." At tenant level the bytes are reclassified from active to archived storage. The cmdlet pages do not describe different behavior for files archived by policy.
- Billing. Archived storage is charged only when archived plus active storage exceeds the tenant's included allocation, at $0.05 per GB per month, against $0.20 for standard storage, per Microsoft's pricing page.
Controls and audit
Setting Set-SPOTenant -AllowFileArchive $false removes the manual Archive action for users. Microsoft states that "admin-defined policies can still archive eligible files automatically," so this setting does not stop a policy. To see what a policy did, search the audit log for the FileArchived event: for policy archiving it includes the policy ID, the policy version and the file's last access date.
Licensing and cost
It is not an E3 or E5 feature by itself. Microsoft's Archive overview calls these "SharePoint Advanced Management (SAM) automatic file archive policies", so SAM licensing applies. Per Microsoft's SAM prerequisites page, you need:
- A base subscription: Office 365 E3, E5 or A5; Microsoft 365 E1, E3, E5 or A5; or the Microsoft 365 GCC, GCC-High or DoD equivalents.
- A SAM entitlement, which is any one of: at least one user in the tenant assigned a Microsoft Copilot license (the user does not need to be an administrator); the SharePoint Advanced Management Plan 1 add-on, for subscriptions that include SharePoint K, P1 or P2; or Microsoft 365 E7.
- Microsoft 365 Archive with pay-as-you-go billing, because archived files land in the archive tier. That means an Azure subscription and resource group, with archive storage billed at $0.05 per GB per month once archived plus active storage exceeds the tenant's included allocation.
What is not confirmed. Microsoft's list of SAM features included with a Copilot license names the inactive sites policy, the site ownership and attestation policies, catalog management and change history, among others, but not file archive policies. Only restricted site creation is explicitly called out as needing the Plan 1 add-on, so we cannot say whether a Copilot license alone covers the file archive policy. Microsoft does not publish a SAM add-on price in the documentation we checked. Confirm the policy specifically with Microsoft or your partner before you plan around it. For the wider SAM picture, see SharePoint Advanced Management licensing.
File types the policy cannot archive
Microsoft's Archive overview lists extensions that SAM automatic file archive policies cannot archive: .js, .css, .one, .onepkg, .onepart, .onetoc2, .onetmp, .spcolor, .sptheme, .spfont, .eot, .onebin, .woff, .woff2, .xsl, .json, .classifier, .aspx, .onetoc, .onebak and .onebackupconstruction. Microsoft states: "These exclusions apply regardless of the file type filters configured for the policy."
OneDrive scope: documented in two ways
The cmdlet reference describes an AllODBSites scope for OneDrive for Business. Microsoft's management page, which covers manual file-level archive, says the Archive action is available on SharePoint sites. Check which applies in your tenant before you assume a policy will reach OneDrive.
What is not documented yet
- How often a policy runs.
- Whether a Microsoft Copilot license alone covers the policy. Microsoft's list of SAM features included with a Copilot license does not name it.
- A general availability date.
- Any interface other than PowerShell.
Where Squirrel differs
Squirrel archives inactive files from SharePoint document libraries on rule-based policies that use last modified date, last accessed date, file type, folder path, library and site. A few differences are worth weighing against Microsoft's policy:
- Criteria. Microsoft's documented policy rules are last-access age and file type, scoped by site. Squirrel also rules on last modified date, folder path and library.
- Where the bytes go. Microsoft's policy keeps files in its archive tier inside SharePoint. Squirrel moves them into an Azure Blob Storage account in your own subscription and leaves a stub with the original name and metadata.
- Copilot. Microsoft's archived files are not used by Copilot. Squirrel's stub summaries keep archived content discoverable.
- Restore. Squirrel has no 120-day wait before a restored file can be archived again.
- Scope. Squirrel covers document library files, not OneDrive.
Frequently asked questions
What is the SharePoint file archive policy?
It is a Microsoft 365 Archive policy that archives files automatically based on their last access date. Microsoft's cmdlet reference describes it as currently in preview.
Which cmdlet creates it?
New-SPOFileArchivePolicy. The policy is created inactive and must be activated with Set-SPOFileArchivePolicy -State Active.
What are the rules?
Months since last access, from 6 to 48 with a default of 24, plus optional file-type include and exclude lists, applied to all SharePoint sites, all OneDrive for Business sites or selected sites.
How do I test it without archiving anything?
Use What-If mode with -IsWhatIfMode $true, then read the run reports with Get-SPOFileArchivePolicyReport. Reports show how many files and how much storage would have been archived.
Can users stop the policy by turning off the Archive button?
No. Setting -AllowFileArchive $false on the tenant blocks manual archiving, but Microsoft states that admin-defined policies can still archive eligible files.
Can a user get an archived file back?
Yes. Anyone with read access can reactivate it, and there is no fee. After reactivation the file cannot be archived again, manually or by policy, for 120 days.
Does it reduce my SharePoint storage figure?
Microsoft's FAQ says file-level archive does not change a site's storage usage, and that at tenant level the bytes move from active to archived storage. The cmdlet pages do not describe a different result for policy archiving.
Do I need E3 or E5 to use it?
E3 and E5 are among the qualifying base subscriptions, and so are Microsoft 365 E1 and A5, but the policy is a SharePoint Advanced Management feature. You also need a SAM entitlement: a Copilot license assigned to any user, the Plan 1 add-on, or Microsoft 365 E7.
Is there an extra licensing cost?
Possibly. Microsoft's list of SAM features included with a Copilot license does not name the file archive policy, so a Copilot license alone may not cover it and the Plan 1 add-on may be needed. Microsoft does not publish an add-on price in the documentation we checked. Archived storage is billed separately through pay-as-you-go, at $0.05 per GB per month once archived plus active storage exceeds the tenant allocation.
Is it generally available?
Microsoft's documentation describes it as preview and gives no general availability date.
Related reading
- Purview retention archiving for SharePoint - the other automatic route into Microsoft 365 Archive.
- Microsoft 365 Archive for SharePoint - setup, pricing and limits.
- SharePoint Advanced Management licensing - which licenses unlock SAM, and what it does for storage.
- See what is using your SharePoint storage - find the inactive content before you write a rule.
- SharePoint Storage Explorer - free tool that reports storage and last-modified age down to the folder.
Mark Smith co-founded SmiKar Software in 2015 and has spent the past decade helping organisations solve Microsoft 365 data management challenges. He works with the SmiKar team to build solutions for SharePoint archiving, storage optimisation, governance and compliance, supporting customers from growing businesses through to Fortune 500 enterprises.
More about SmiKar


