posts
$envTermGroup = "Document Management Tags" $termSId = "b6ddada5-25b5-xxx-xxxx-b473235d6278" #c65620d8-ee35-4a47-83ed-3da15bf74a0a" #Tags old term set $csvPath = "C:\Users\343614\OneDrive - ssss\Documents\scripts\termsets_import\Import csv - all tags - with synonyms - Delta - test.csv" $logFile = ".\term_synonyms_Log-$(Get-Date -Format "yyyyMMdd-HHmm").csv" function Log-Message { param ( [string]$Message, [string]$Status ) switch ($Status) { "Success" { $color = "Green" } "Info" { $color = "Blue" } "Error" { $color = "Red" } default { $color = "White" } } Write-Host -ForegroundColor $color "$Status => $Message" $logEntry = [PSCustomObject]@{ Timestamp = (Get-Date).
posts
Auto Trimming version - Minor Major # ===== Settings ===== $clientId = "xxxxxxxx" $dateTime = Get-Date -Format "yyyy-MM-dd-HH-mm-ss" $CertPath = Read-Host "Please enter Certificate (.PFX) Path" $CertPassword = Read-Host "Please enter Certificate Password" -AsSecureString $Org = "contoso.onmicrosoft.com" $fileUrl = "https://contoso.sharepoint.com/sites/test/Documents/test_resh_retentionlabel.docx" $invocation = Get-Variable -Name MyInvocation -ValueOnly $directoryPath = Split-Path $invocation.MyCommand.Path function Get-LibraryNameFromFileUrl { param([string]$fileUrl, [string]$siteUrl) # Remove base site URL $relative = $fileUrl.Replace($siteUrl, "") # Trim leading "/" if ($relative.StartsWith("/")) { $relative = $relative.
posts
I have been doing some testing: major versions are trimmed if exceeding the 500 versions, minor versions gets incremented up to 511 and beyond end user needs to publish as major. Auto trimming works with files without retention labels trimming the minor/major version bypassing the recycle bin.
However with files with retention labels are behaving similarly to retention policy and none of the major or minor versions get deleted, version are expired only to be extended further for more days after 1-2 days instead being deleted.