Skip to content

Update File Archive Policy cmdlets for OneDrive support - #1204

Merged
Aditi Srivastava (aditisrivastava07) merged 3 commits into
MicrosoftDocs:mainfrom
HectorRMota:user/hemota/filearchivepolicy-odb-support
Sep 7, 2026
Merged

Update File Archive Policy cmdlets for OneDrive support#1204
Aditi Srivastava (aditisrivastava07) merged 3 commits into
MicrosoftDocs:mainfrom
HectorRMota:user/hemota/filearchivepolicy-odb-support

Conversation

@HectorRMota

Copy link
Copy Markdown
Contributor

Summary

Updates the File Archive Policy cmdlet reference to cover OneDrive for Business support and the site exclusion model, and corrects the guidance for the file type criteria parameters.

These cmdlets were first documented in #1181. This PR reflects subsequent changes to the cmdlet surface.

Changes

Add-SPOSiteToFileArchivePolicy

  • Documents the new -Exclude switch.
  • Explains the two modes: inclusions are only valid for a SelectedSites policy, exclusions only for an AllSites or AllODBSites policy. Using the wrong one returns an error.
  • Adds an exclusion example and notes the 1,000 site per policy limit.

New-SPOFileArchivePolicy and Set-SPOFileArchivePolicy

  • Adds AllODBSites to the accepted values for -PolicyType, for policies that target all OneDrive for Business sites in the tenant.
  • Documents the new -FileTypeExclusionCriteria parameter.
  • Set-SPOFileArchivePolicy: corrects the activation rule, which also applies to AllODBSites.

Get-SPOFileArchivePolicySites

  • Clarifies that the returned list is the included sites for a SelectedSites policy, and the excluded sites for an AllSites or AllODBSites policy.

Remove-SPOSiteToFileArchivePolicy

  • Clarifies that it removes either an inclusion or an exclusion, and documents the guard that prevents removing the last site from an active SelectedSites policy.

Corrects a published error

The existing New-SPOFileArchivePolicy Example 2 passes -FileTypeCriteria:

New-SPOFileArchivePolicy -PolicyType "SelectedSites" -Name "ArchiveMarketing" -LastAccessDateCriteria 12 -FileTypeCriteria ".docx", ".pptx", ".xlsx"

File type filtering is not implemented in the current preview, and the service rejects any non-null value for this parameter with "Updating file type criteria is not supported." The example as published would fail for anyone who ran it, so it has been replaced with one that works.

Both -FileTypeCriteria and -FileTypeExclusionCriteria are now documented with a note describing the current behavior, so the newly added parameter isn't presented as functional either.

Notes for reviewers

  • The feature is in preview and gated behind a rollout flight, so none of this is customer-visible yet. Every affected topic already carries the existing preview note.
  • No new topics are added and no files are renamed; all changes are to the five existing File Archive Policy topics. The module landing page needs no update, since the cmdlet summaries are unchanged.

Documents the AllODBSites policy type and the site exclusion model, and
corrects guidance for the file type criteria parameters.

Add-SPOSiteToFileArchivePolicy:
- Document the new -Exclude switch.
- Explain that inclusions are only valid for SelectedSites policies and
  exclusions only for AllSites/AllODBSites policies.
- Add an exclusion example and note the 1,000 site limit per policy.

New-SPOFileArchivePolicy / Set-SPOFileArchivePolicy:
- Add AllODBSites to the accepted values for -PolicyType.
- Document the new -FileTypeExclusionCriteria parameter.
- Note that file type filtering is not implemented in the current preview:
  supplying -FileTypeCriteria or -FileTypeExclusionCriteria returns an
  error. The previous New-SPOFileArchivePolicy example passed
  -FileTypeCriteria and would have failed, so it has been replaced.
- Set-SPOFileArchivePolicy: correct the activation rule to include
  AllODBSites.

Get-SPOFileArchivePolicySites:
- Clarify that the cmdlet returns included sites for a SelectedSites
  policy and excluded sites for an AllSites/AllODBSites policy.

Remove-SPOSiteToFileArchivePolicy:
- Clarify that it removes either an inclusion or an exclusion, and
  document the guard against removing the last site from an active
  SelectedSites policy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

@HectorRMota
HectorRMota marked this pull request as ready for review September 3, 2026 23:51
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

sachin-lalwani
You've been added as a reviewer to this pull request because you're listed as a Content Lead for the product area or feature covered by one or more articles in this PR.

Before this PR can be merged, a Content Lead needs to add the Sign off label to it. Only one of the listed reviewers needs to add the Sign off label. Before you sign off a PR, confirm the following:

  • The PR is not in draft state. When the changes in this PR are ready to be published, select the Ready to merge button at the bottom of the page.
  • Article content has been checked for technical accuracy.
  • There are no errors or warnings in build validation.
  • There are no severity 1 or 2 PoliCheck issues.
  • All required PR checks at the bottom of the PR are passing.

After you've confirmed the above, do the following to sign off:

  1. Select the gear next to Labels.
  2. Select Sign off from the label list.
  3. Click away from the label list.

image

After you've signed off, our operations (PubOps) team will review the PR for issues that may impact formatting and the customer experience. If any changes are needed, they will return
the PR to the submitter with required changes. After they've completed those changes, you need to sign off again.

When the PR passes PubOps review, they'll merge the PR. If the PR is merged into the main branch, changes will go live within the next couple hours.

If you think you were incorrectly added as a reviewer, have questions about this process, or need help signing off on this PR, post a message to https://aka.ms/tcphelp.


> [!NOTE]
> File type filtering isn't implemented in the current preview. Supplying this parameter returns the error "Updating file type criteria is not supported. Please remove and recreate the policy." Omit the parameter to create the policy with all file types included.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer this is implemented in backend so we avoid this note altogether

@HectorRMota HectorRMota Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - removing note and this will be handled in the back end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@samkabue-msft Sam M. Kabue (samkabue-msft) added Back to submitter The pull request didn't pass the review criteria and has been returned to the writer for updates Microsoft submitter labels Sep 4, 2026
Implementation status of the service backend doesn't belong in the public
cmdlet reference. The -FileTypeCriteria and -FileTypeExclusionCriteria
parameters are now described in terms of their intended behavior only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@samkabue-msft Sam M. Kabue (samkabue-msft) added Sign off The pull request is ready to be reviewed and merged by PubOps and removed Back to submitter The pull request didn't pass the review criteria and has been returned to the writer for updates labels Sep 5, 2026
@aditisrivastava07 Aditi Srivastava (aditisrivastava07) added the In review PubOps is reviewing the pull request label Sep 7, 2026
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

@aditisrivastava07
Aditi Srivastava (aditisrivastava07) merged commit d1a4cdb into MicrosoftDocs:main Sep 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In review PubOps is reviewing the pull request Microsoft submitter sharepoint-server-itpro/svc Sign off The pull request is ready to be reviewed and merged by PubOps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants