| 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-spolistfileversionbatchdeletejob |
| applicable | SharePoint Online |
| title | New-SPOListFileVersionBatchDeleteJob |
| schema | 2.0.0 |
| author | msjennywu |
| ms.author | jennywu |
| ms.reviewer | |
| manager | seanmc |
Queues a job to trim versions from a document library.
New-SPOListFileVersionBatchDeleteJob [-Site] <SpoSitePipeBind> -List <SPOListPipeBind> [-Automatic] [-WhatIf]
[-Confirm] [<CommonParameters>]
New-SPOListFileVersionBatchDeleteJob [-Site] <SpoSitePipeBind> -List <SPOListPipeBind>
[-DeleteBeforeDays <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]
New-SPOListFileVersionBatchDeleteJob [-Site] <SpoSitePipeBind> -List <SPOListPipeBind>
-MajorVersionLimit <Int32> -MajorWithMinorVersionsLimit <Int32> [-WhatIf] [-Confirm] [<CommonParameters>]
New-SPOListFileVersionBatchDeleteJob [-Site] <SpoSitePipeBind> -List <SPOListPipeBind> [-FileTypes <String[]>]
[-ExcludeDefaultPolicy] [-TrimUseListPolicy] [-WhatIf] [-Confirm] [<CommonParameters>]
Queues a job to trim versions from a document library.
Caution: Versions trimmed using this command will be permanently deleted and cannot be recovered from the recycle bin.
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -DeleteBeforeDays 360Example 1 starts a trim job that will delete all file versions that are over 360 days old in the document library called "Documents".
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -AutomaticExample 2 starts a trim job that will delete file versions that expired and set version expiration time for the ones not expired in the document library called "Documents" based on the automatic backend algorithm.
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -MajorVersionLimit 30 -MajorWithMinorVersionsLimit 10Example 3 starts a trim job that will delete file versions in the document library called "Documents" based on the version count limits.
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -TrimUseListPolicyExample 4 starts a trim job that will delete file versions in the document library called "Documents" based on the version history limits of the document library.
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -TrimUseListPolicy -FileTypes @("Video", "Audio")Example 5 starts a trim job that will delete file versions for video and audio file types, and file versions that do not belong to a file type override in the document library based on the version history limits of the document library.
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -TrimUseListPolicy -FileTypes @("Video", "Audio") -ExcludeDefaultPolicyExample 6 starts a trim job that will delete file versions for video and audio file types in the document library based on the version history limits of the document library.
Trim file versions using automatic version history limit algorithm.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: AutomaticTrim
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe minimum age of file versions to trim. In other words, all file versions that are older than this number of days will be deleted.
Type: System.Int32
Parameter Sets: DeleteOlderThanDays
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIndicates whether to trim versions based on the default version history limits.
Note
This feature is currently in preview and may not be available in your tenant.
Type: SwitchParameter
Parameter Sets: ByPolicy
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn array of file type names to trim versions. The supported file type names are:
- Audio
- OutlookPST
- Video
Note
This feature is currently in preview and may not be available in your tenant.
Type: String[]
Parameter Sets: ByPolicy
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe document library name or Id.
Type: Microsoft.Online.SharePoint.PowerShell.SPOListPipeBind
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseTrim file version using version count limits. Need to specify MajorWithMinorVersionsLimit as well.
Type: System.Int32
Parameter Sets: CountLimits
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseTrim file version using version count limits. Need to specify MajorVersionLimit as well.
Type: System.Int32
Parameter Sets: CountLimits
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseApplicable: SharePoint Online
Specifies the URL of the site.
Type: Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIndicates whether to trim versions by applying the document library's version history limits.
Note
This feature is currently in preview and may not be available in your tenant.
Type: SwitchParameter
Parameter Sets: ByPolicy
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: System.Management.Automation.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, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.