| 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-spotenantapplyfileversionpolicyjob |
| applicable | SharePoint Online |
| title | New-SPOTenantApplyFileVersionPolicyJob |
| schema | 2.0.0 |
| author | msjennywu |
| ms.author | jennywu |
| ms.reviewer | |
| manager | seanmc |
Queues a job to apply the tenant-level file version policy across all sites. SharePoint Advanced Management license or Copilot license is required to run this cmdlet.
Note
This feature is currently in preview and may not be available in your tenant.
New-SPOTenantApplyFileVersionPolicyJob [-TrimVersions] [-SetVersionPolicy] [-WhatIf] [-Confirm] [<CommonParameters>]
Queues a job to apply the tenant-level file version policy across all sites. The job trims existing file versions and/or sets version policy for existing document libraries based on the version policy configured at the tenant level.
The following site types are excluded from processing:
- Read-only sites
- Locked sites
- Archived sites
- Sites with version policy broken inheritance
Note
- Versions deleted using this cmdlet will be permanently deleted and cannot be recovered from the recycle bin.
- Use
Get-SPOTenantcmdlet and theEnableAutoExpirationVersionTrim,MajorVersionLimit,ExpireVersionsAfterDaysandVersionPolicyFileTypeOverrideproperties to confirm the tenant-level file version policy before running the cmdlet to make sure it matches your intended configuration. - If the tenant-level version policy changes while the job is in progress, the job will apply the updated policy to the remaining sites that have not yet been processed. Sites that were already processed will not be re-evaluated or updated.
- Allow only one job per tenant.
New-SPOTenantApplyFileVersionPolicyJob -TrimVersions -SetVersionPolicyExample 1 starts a tenant apply file version policy job to trim existing versions and set version policy for existing document libraries across all sites.
New-SPOTenantApplyFileVersionPolicyJob -TrimVersionsExample 2 starts a tenant apply file version policy job to trim existing versions for files in document libraries across all sites.
New-SPOTenantApplyFileVersionPolicyJob -SetVersionPolicyExample 3 starts a tenant apply file version policy job to set version policy for existing document libraries across all sites.
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSets version policy for existing document libraries across all sites based on the tenant-level file version policy. The version policy applies to new versions created in these existing document libraries.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseTrims existing versions for files in document libraries across all sites based on the tenant-level file version policy.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Get-SPOTenantApplyFileVersionPolicyJobProgress
Remove-SPOTenantApplyFileVersionPolicyJob