Skip to content

Latest commit

 

History

History
242 lines (181 loc) · 6.76 KB

File metadata and controls

242 lines (181 loc) · 6.76 KB
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-spositemanageversionpolicyjob
applicable SharePoint Online
title New-SPOSiteManageVersionPolicyJob
schema 2.0.0
author blarrywangmsft
ms.author blarrywang
ms.reviewer

New-SPOSiteManageVersionPolicyJob

SYNOPSIS

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.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ExcludeDefaultPolicy

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

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-FileTypes

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

  • Audio
  • OutlookPST
  • Video
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Identity

Applicable: SharePoint Online

Specifies the URL of the site collection.

Type: SpoSitePipeBind
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: 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.

Type: SwitchParameter
Parameter Sets: MandatoryTrimOptionalSync
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: MandatorySync
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TrimUseListPolicy

Indicates whether to trim existing versions.

Type: SwitchParameter
Parameter Sets: MandatoryTrimOptionalSync
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows 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: False

CommonParameters

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

INPUTS

Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind

OUTPUTS

System.Object

NOTES

RELATED LINKS

Get-SPOSiteManageVersionPolicyJobProgress Remove-SPOSiteManageVersionPolicyJob