Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Connect-IPPSSession # compliance endpoint
- Connect-IPPSSession -EnableSearchOnlySession
- # Define the search name once
- $SearchName = "11072025_01"
- # See recent compliance actions
- Get-ComplianceSearchAction | Where-Object { $_.JobEndTime -gt (Get-Date).AddDays(-1) }
- # Create purge action
- $params = @{
- SearchName = $SearchName
- Purge = $true
- Force = $true
- PurgeType = 'Softdelete'
- ActionName = "${SearchName}_Purge"
- }
- New-ComplianceSearchAction @params
- # Define Purge Action variable automatically
- $PurgeAction = "${SearchName}_Purge"
- # Get purge action details
- Get-ComplianceSearchAction -Identity $PurgeAction | Format-List Identity,Action,Status,StartTime,EndTime,PercentComplete,SuccessResults,ErrorResults
- # Get compliance search status
- Get-ComplianceSearch -Identity $SearchName | Format-List Status,Items
- # Get purge action status again
- Get-ComplianceSearchAction -Identity $PurgeAction | Format-List
Advertisement
Add Comment
Please, Sign In to add comment