NOTE: Do not just simply copy/paste the above. You need to actually select the DisplayName property using the Insert Property button. Otherwise the necessary MP references will not be created behind the scenes.

Update [June 20, 2011] – I’ve changed this in the 7.0.6555.1 version of the MP to use the FullName instead of the DisplayName since display names that had quotes or double quotes in them were throwing off the parameter sequence. The best way to handle this would be to pass the ID, but we need to add support to the Get-SCSMObject cmdlet in SMLets to allow a GUID ID to be passed in first. For now FullName will do the trick. FullName is the class name + : + the key property values (which would rarely if ever contain a quote or double quote).

The new command looks like this. Note: you can’t use the Insert button to insert the $Context/?$FullName$? – you’ll need to just type that in or copy paste it from here:

Now you will have a new console task in the actions pane on any view in the work items and configuration items workspaces when you have an object selected.

When you click on it a PowerShell window will pop up and confirm that you want to delete the object. It will first prompt you if you want to delete the object and then it will ask you to commit it. I don’t know why it does the second prompt but whatever, better safe than sorry I guess. You need to respond Y to both.

BE VERY CAREFUL USING THIS TASK. THERE IS NO UNDO!

This requires SMLets of course. You can download it here and install it on all your console machines.

Only administrators will be able to use this task but anybody can see it unless you use user roles to scope away visibility of this task.

If you want to make this task available on a subset of classes instead of all, you can just choose a different target like the incident class, computer class, etc.

I’ve uploaded the management pack for this to the SCSM Gallery on TechNet.