Share via


New-SPOSiteManageVersionPolicyJob

Starts a background job to manage file versions and version history limits for all document libraries in the given site.

Note

This feature is currently in preview and may not be available in your tenant.

Syntax

MandatoryTrimOptionalSync

New-SPOSiteManageVersionPolicyJob
    [-Identity] <SpoSitePipeBind>
    [-FileTypes <String[]>]
    [-ExcludeDefaultPolicy]
    [-TrimUseListPolicy]
    [-SyncListPolicy]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

MandatorySync

New-SPOSiteManageVersionPolicyJob
    [-Identity] <SpoSitePipeBind>
    [-FileTypes <String[]>]
    [-ExcludeDefaultPolicy]
    [-SyncListPolicy]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Starts a background job that does one or more of the following:

  • sets the version history limits of all document libraries to that of the site;
  • trims version in all document libraries according to each list's version history limits.

This effect can be applied to default version history limits, or a set of file types. Supported file types are:

  • Audio
  • OutlookPST
  • Video

Examples

Example 1

New-SPOSiteManageVersionPolicyJob -Identity https://contoso.sharepoint.com/sites/site1 -SyncListPolicy -FileTypes @("Video","Audio")

Apply the site video, audio, and default version history limits to existing document libraries. If the site is not broken inheritance for version history limits, then it applies the tenant version history limits.

Example 2

New-SPOSiteManageVersionPolicyJob -Identity https://contoso.sharepoint.com/sites/site1 -SyncListPolicy -FileTypes @("Video","Audio") -ExcludeDefaultPolicy

Apply the site video, audio version history limits to existing document libraries. If the site is not broken inheritance for version history limits, then it applies the tenant version history limits.

Example 3

New-SPOSiteManageVersionPolicyJob -Identity https://contoso.sharepoint.com/sites/site1 -SyncListPolicy

Apply the site version history limits (including file type overrides) to existing document libraries. If the site is not broken inheritance for version history limits, then it applies the tenant version history limits.

Example 4

New-SPOSiteManageVersionPolicyJob -Identity https://contoso.sharepoint.com/sites/site1 -TrimUseListPolicy -FileTypes @("Video","Audio")

Trim video and audio file versions, and the file versions that don't have a file type override, based on each document library's version history limits.

Example 5

New-SPOSiteManageVersionPolicyJob -Identity https://contoso.sharepoint.com/sites/site1 -TrimUseListPolicy -FileTypes @("Video","Audio") -ExcludeDefaultPolicy

Trim video and audio file versions based on each document library's version history limits.

Example 6

New-SPOSiteManageVersionPolicyJob -Identity https://contoso.sharepoint.com/sites/site1 -TrimUseListPolicy

Trim all file versions based on each document library's version history limits.

Example 7

New-SPOSiteManageVersionPolicyJob -Identity https://contoso.sharepoint.com/sites/site1 -SyncListPolicy -TrimUseListPolicy

Apply the site version history limits (including file type overrides) to existing document libraries. If the site is not broken inheritance for version history limits, then it applies the tenant version history limits. Then trim all file versions based on each document library's version history limits.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExcludeDefaultPolicy

Indicates whether to update the default version history limits and/or to trim file versions that don't have an override.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FileTypes

An array of file type names. The supported file type names are:

  • Audio
  • OutlookPST
  • Video

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Identity

Applicable: SharePoint Online

Specifies the URL of the site collection.

Parameter properties

Type:SpoSitePipeBind
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-SyncListPolicy

Indicates whether to update all of the document libraries' version history limits to that of the site. Or if the site is not broken inheritance for version history limits, then it applies the tenant version history limits.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

MandatoryTrimOptionalSync
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TrimUseListPolicy

Indicates whether to trim existing versions.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

MandatoryTrimOptionalSync
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind

Outputs

System.Object