aleinss

Untitled

Nov 7th, 2025
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #Connect-IPPSSession # compliance endpoint
  2. Connect-IPPSSession -EnableSearchOnlySession
  3.  
  4. # Define the search name once
  5. $SearchName = "11072025_01"
  6.  
  7. # See recent compliance actions
  8. Get-ComplianceSearchAction | Where-Object { $_.JobEndTime -gt (Get-Date).AddDays(-1) }
  9.  
  10. # Create purge action
  11. $params = @{
  12. SearchName = $SearchName
  13. Purge = $true
  14. Force = $true
  15. PurgeType = 'Softdelete'
  16. ActionName = "${SearchName}_Purge"
  17. }
  18. New-ComplianceSearchAction @params
  19.  
  20. # Define Purge Action variable automatically
  21. $PurgeAction = "${SearchName}_Purge"
  22.  
  23. # Get purge action details
  24. Get-ComplianceSearchAction -Identity $PurgeAction | Format-List Identity,Action,Status,StartTime,EndTime,PercentComplete,SuccessResults,ErrorResults
  25.  
  26. # Get compliance search status
  27. Get-ComplianceSearch -Identity $SearchName | Format-List Status,Items
  28.  
  29. # Get purge action status again
  30. Get-ComplianceSearchAction -Identity $PurgeAction | Format-List
  31.  
Advertisement
Add Comment
Please, Sign In to add comment