How to delete SCSM 2012 incidents
Today I was asked how to delete some scsm test incidents. We had to know that some CMDLets are available using the built-in SCSM 2012, but you can also use the codeplex smlets commands.
The cmdlets reference are available at:
http://blog.scsmsolutions.com/2012/02/reference-between-smlets-and-scsm-2012-native-cmdlets/
The old cmdlet using the SMLets to delete incident was something like:
Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.Incident$) -Filter "ID -eq 'IR10'” | Remove-SCSMObject –Force
**
**Now the command using the built-in CMDLet available with the SCSM 2012 is something like:
Get-SCSMClassInstance -Class (Get-SCSMClass -Name System.WorkItem.Incident) | Where-Object {$_.ID -eq "IR10"} | Remove-SCSMClassInstance
**
**This command must delete only one incidente a time. To delete multiple incidentes you´ll have to change some things.
Hope this is useful.
Regards,
Gustavo de Freitas Alves
Hepta Tecnologia e Informática