|
| 1 | +--- |
| 2 | +external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml |
| 3 | +Module Name: microsoft.online.sharepoint.powershell |
| 4 | +online version: https://learn.microsoft.com/powershell/module/microsoft.online.sharepoint.powershell/new-spotenantapplyfileversionpolicyjob |
| 5 | +applicable: SharePoint Online |
| 6 | +title: New-SPOTenantApplyFileVersionPolicyJob |
| 7 | +schema: 2.0.0 |
| 8 | +author: msjennywu |
| 9 | +ms.author: jennywu |
| 10 | +ms.reviewer: |
| 11 | +manager: seanmc |
| 12 | +--- |
| 13 | + |
| 14 | +# New-SPOTenantApplyFileVersionPolicyJob |
| 15 | + |
| 16 | +## SYNOPSIS |
| 17 | + |
| 18 | +> [!NOTE] |
| 19 | +> This feature is part of the version history controls preview. If your tenant is not part of the preview or the feature has not rolled out to your tenant, you will get an error when trying to run this cmdlet. |
| 20 | +
|
| 21 | +Queues a job to apply the tenant-level file version policy across all sites. SharePoint Advanced Management (SAM) license is required to run this cmdlet. |
| 22 | + |
| 23 | +## SYNTAX |
| 24 | + |
| 25 | +``` |
| 26 | +New-SPOTenantApplyFileVersionPolicyJob [-TrimVersions] [-SetVersionPolicy] [-WhatIf] [-Confirm] |
| 27 | + [<CommonParameters>] |
| 28 | +``` |
| 29 | + |
| 30 | +## DESCRIPTION |
| 31 | + |
| 32 | +Queues a job to apply the tenant-level file version policy across all sites. The job trims existing file versions and/or set version policy for existing document libraries based on the version policy configured at the tenant level. |
| 33 | + |
| 34 | +The following site types are excluded from processing: |
| 35 | + |
| 36 | +- Read-only sites |
| 37 | + |
| 38 | +- Locked sites |
| 39 | + |
| 40 | +- Archived sites |
| 41 | + |
| 42 | +- Sites with version policy broken inheritance |
| 43 | + |
| 44 | +Caution: |
| 45 | +- Versions deleted using this cmdlet will be permanently deleted and cannot be recovered from the recycle bin. |
| 46 | +- If the tenant-level version policy is modified 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. |
| 47 | + |
| 48 | +## EXAMPLES |
| 49 | + |
| 50 | +### Example 1 |
| 51 | +```powershell |
| 52 | +New-SPOTenantApplyFileVersionPolicyJob -TrimVersions -SetVersionPolicy |
| 53 | +``` |
| 54 | + |
| 55 | +Example 1 starts a tenant apply file version policy job to trim versions and set version policy for existing document libraries across all sites. |
| 56 | + |
| 57 | +### Example 2 |
| 58 | +```powershell |
| 59 | +New-SPOTenantApplyFileVersionPolicyJob -TrimVersions |
| 60 | +``` |
| 61 | + |
| 62 | +Example 2 starts a tenant apply file version policy job to trim versions for files in doducment libraries across all sites. |
| 63 | + |
| 64 | +### Example 3 |
| 65 | +```powershell |
| 66 | +New-SPOTenantApplyFileVersionPolicyJob -SetVersionPolicy |
| 67 | +``` |
| 68 | + |
| 69 | +Example 3 starts a tenant apply file version policy job to set version policy for existing document libraries across all sites. |
| 70 | + |
| 71 | +## PARAMETERS |
| 72 | + |
| 73 | +### -Confirm |
| 74 | +Prompts you for confirmation before running the cmdlet. |
| 75 | + |
| 76 | +```yaml |
| 77 | +Type: SwitchParameter |
| 78 | +Parameter Sets: (All) |
| 79 | +Aliases: cf |
| 80 | + |
| 81 | +Required: False |
| 82 | +Position: Named |
| 83 | +Default value: None |
| 84 | +Accept pipeline input: False |
| 85 | +Accept wildcard characters: False |
| 86 | +``` |
| 87 | +
|
| 88 | +### -SetVersionPolicy |
| 89 | +Set version policy for existing document libraries across all sites. |
| 90 | +
|
| 91 | +```yaml |
| 92 | +Type: SwitchParameter |
| 93 | +Parameter Sets: (All) |
| 94 | +Aliases: |
| 95 | + |
| 96 | +Required: False |
| 97 | +Position: Named |
| 98 | +Default value: None |
| 99 | +Accept pipeline input: False |
| 100 | +Accept wildcard characters: False |
| 101 | +``` |
| 102 | +
|
| 103 | +### -TrimVersions |
| 104 | +Trim versions for files in document libraries across all sites. |
| 105 | +
|
| 106 | +```yaml |
| 107 | +Type: SwitchParameter |
| 108 | +Parameter Sets: (All) |
| 109 | +Aliases: |
| 110 | + |
| 111 | +Required: False |
| 112 | +Position: Named |
| 113 | +Default value: None |
| 114 | +Accept pipeline input: False |
| 115 | +Accept wildcard characters: False |
| 116 | +``` |
| 117 | +
|
| 118 | +### -WhatIf |
| 119 | +Shows what would happen if the cmdlet runs. |
| 120 | +The cmdlet is not run. |
| 121 | +
|
| 122 | +```yaml |
| 123 | +Type: SwitchParameter |
| 124 | +Parameter Sets: (All) |
| 125 | +Aliases: wi |
| 126 | + |
| 127 | +Required: False |
| 128 | +Position: Named |
| 129 | +Default value: None |
| 130 | +Accept pipeline input: False |
| 131 | +Accept wildcard characters: False |
| 132 | +``` |
| 133 | +
|
| 134 | +### CommonParameters |
| 135 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). |
| 136 | +
|
| 137 | +## INPUTS |
| 138 | +
|
| 139 | +### None |
| 140 | +
|
| 141 | +## OUTPUTS |
| 142 | +
|
| 143 | +### System.Object |
| 144 | +## NOTES |
| 145 | +
|
| 146 | +## RELATED LINKS |
| 147 | +
|
| 148 | +[Get-SPOTenantApplyFileVersionPolicyJobProgress](Get-SPOTenantApplyFileVersionPolicyJobProgress.md) |
| 149 | +
|
| 150 | +[Remove-SPOTenantApplyFileVersionPolicyJob](Remove-SPOTenantApplyFileVersionPolicyJob.md) |
0 commit comments