Quantcast
Channel: SCSM PowerShell Cmdlets
Viewing all articles
Browse latest Browse all 306

New Post: Can I schedule Remove-SCSMObject -Force?

$
0
0
I would like to schedule every mounth Remove-SCSMObject for remove all Incidents that have priority 6,8,9.
This is possible with the cmdlet bilow:

$irClass = Get-SCSMClass -Name System.WorkItem.Incident$
Get-SCSMObject -Class $irClass | Where {$_.Priority -ne 8 -and $_.Priority -ne 9 -and $_.Priority -ne 6 -and $_.FirstAssignedDate -eq $null} | Remove-SCSMObject -Force

I'm wondering what the impact of schedule deleting this behavior. Anybody out there using Remove-SCSMObject cmdlet in this way right now?

Viewing all articles
Browse latest Browse all 306

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>