ListItem.SetComplianceTagWithMeta
Using PowerShell PnP to set Retention Label with labelled date. Not for use in Production but handy for testing.
connect-pnponline -url <url> -UseWebLogin
$context = Get-PnPContext
$files = get-pnplistitem -List <ListName>
$file = $files[<id>]
$complianceTagWrittenDate = (Get-Date -Month 1 -Day 1 -Year 2000)
$file.SetComplianceTagWithMetaInfo($labelName, $isPolicyHold, $isPolicyRecord, $complianceTagWrittenDate, $userEmailAddress, $false)
$context.ExecuteQuery()
Leave a Reply