Update File Archive Policy cmdlets for OneDrive support - #1204
Conversation
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>
PoliCheck Scan ReportThe 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 foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit 832c31d: ✅ Validation status: passed
For more details, please refer to the build report. |
|
sachin-lalwani 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:
After you've confirmed the above, do the following to sign off:
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 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. | ||
|
|
There was a problem hiding this comment.
I'd prefer this is implemented in backend so we avoid this note altogether
There was a problem hiding this comment.
Agreed - removing note and this will be handled in the back end
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>
PoliCheck Scan ReportThe 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 foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit ff37af9: ✅ Validation status: passed
For more details, please refer to the build report. |
PoliCheck Scan ReportThe 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 foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit 42c63e7: ✅ Validation status: passed
For more details, please refer to the build report. |
d1a4cdb
into
MicrosoftDocs:main

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-Excludeswitch.SelectedSitespolicy, exclusions only for anAllSitesorAllODBSitespolicy. Using the wrong one returns an error.New-SPOFileArchivePolicyandSet-SPOFileArchivePolicyAllODBSitesto the accepted values for-PolicyType, for policies that target all OneDrive for Business sites in the tenant.-FileTypeExclusionCriteriaparameter.Set-SPOFileArchivePolicy: corrects the activation rule, which also applies toAllODBSites.Get-SPOFileArchivePolicySitesSelectedSitespolicy, and the excluded sites for anAllSitesorAllODBSitespolicy.Remove-SPOSiteToFileArchivePolicySelectedSitespolicy.Corrects a published error
The existing
New-SPOFileArchivePolicyExample 2 passes-FileTypeCriteria: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
-FileTypeCriteriaand-FileTypeExclusionCriteriaare now documented with a note describing the current behavior, so the newly added parameter isn't presented as functional either.Notes for reviewers