Delete Incidents
Hi, We used our production environment for some testing and before go live we want to delete the test incidents. Can you please advise if that is possible? Thanks Sally
June 15th, 2010 8:28am

Hi, I would re-install the product instead of taking a test environment into production.Anders Bengtsson | Microsoft MVP - Operations Manager | http://www.contoso.se
Free Windows Admin Tool Kit Click here and download it now
June 15th, 2010 9:11am

I would be intrested in the ability to delete incidents We are building a number of SM Instances for our clients and before we go live with the product it would be good to delete all the test incidents etc, as well as deleting incidents along the way in the future months of required
June 15th, 2010 4:28pm

You can delete them from the ServiceManager SQL Database in the MT_System$WorkItem$Incident table, this will of course break any links to this record, however, it does have the desired effect if you don't want to reinstall the whole application. Hope this helps Cheers, Richard This solution is provided "as is" with no express or implied warranty for accuracy or accessibilityRAM
Free Windows Admin Tool Kit Click here and download it now
June 16th, 2010 1:47pm

Hi Richard. Thanks. I deleted one just to test however now under All Incidents it shows still without much information and you cannot open it. It is just showing the Display name/ Last modified and the affected user. How do I delete that as well? Thanks for your help Sally
June 17th, 2010 2:34am

Travis Wright has written a blog post regarding this -> http://blogs.technet.com/b/servicemanager/archive/2009/12/17/deleting-objects-in-bulk-in-the-cmdb-using-powershell.aspx I tried this the other day and it worked fine.
Free Windows Admin Tool Kit Click here and download it now
June 17th, 2010 3:54pm

Where do I find the class? I want to delete all users..... but would like to know how to find other classes as in the future I might want to delete all the incidents for example?
June 17th, 2010 9:01pm

The classes can be found by using the authoring tool, or by running Select * From dbo.ManagedType against the ServiceManager Database
Free Windows Admin Tool Kit Click here and download it now
June 17th, 2010 11:10pm

Hi Alexander, Do you have the exact Powershell script you ran to delete All incidents? Thanks
June 22nd, 2010 4:44am

Hi Sally, First save the script from http://jtruher.spaces.live.com/blog/cns!7143DA6E51A2628D!843.entry?sa=114167327 as get-smobject.ps1. Then save the script from http://jtruher.spaces.live.com/blog/cns!7143DA6E51A2628D!794.entry as remove-smobject.ps1. Run ".\get-smobject.ps1 System.WorkItem.Incident | .\remove-smobject.ps1 -whatif". Remove the -whatif parameter when you're happy to commit. /Alexander
Free Windows Admin Tool Kit Click here and download it now
June 22nd, 2010 12:00pm

You can also just run Remove-SCSMObject.ps1 System.WorkItem.Incident Travis Wright Senior Program Manager Lead Microsoft
July 9th, 2010 12:36am

Hi Sally, First save the script from http://jtruher.spaces.live.com/blog/cns!7143DA6E51A2628D!843.entry?sa=114167327 as get-smobject.ps1. Then save the script from http://jtruher.spaces.live.com/blog/cns!7143DA6E51A2628D!794.entry as remove-smobject.ps1. Run ".\get-smobject.ps1 System.WorkItem.Incident | .\remove-smobject.ps1 -whatif". Remove the -whatif parameter when you're happy to commit. /Alexander Running ".\get-smobject.ps1 System.WorkItem.Incident" seems to remove the incidents without the remove-smobject piping! So what exactly does the other script do??? I checked and double checked, get-smobject.ps1 in this form wipes all incidents clean. I'm thankful because finally I can quickly delete incidents. I changed the ConfirmImpact property to "Low" for swift, uninterrupted deleting!!
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2010 5:30pm

Please dont do it this way! :) Try using the PowerShell cmdlet: http://blogs.technet.com/servicemanager/archive/2009/12/17/deleting-objects-in-bulk-in-the-cmdb-using-powershell.aspxTravis Wright Senior Program Manager Lead Microsoft
September 21st, 2010 5:35am

BTW - these scripts are not cmdlets that you can use in the SMLets CodePlex project here: http://blogs.technet.com/b/servicemanager/archive/2010/08/05/service-manager-smlets-codeplex-project-expanded.aspxTravis Wright Senior Program Manager Lead Microsoft
Free Windows Admin Tool Kit Click here and download it now
September 21st, 2010 5:36am

Please dont do it this way! :) This was useful only in the first days of testing when I wanted to clear the tens of test incidents I had created :)
September 21st, 2010 6:46pm

I would like to delete all the incidents created with particular name exp: (servicedesk@abc.com), is there anyway..? please advise.Krishna
Free Windows Admin Tool Kit Click here and download it now
July 12th, 2011 8:33pm

What do you mean by "with a particular name"? Do you mean, created by a particular user? A certain value in the incident title? Related to a certain affected user?Travis Wright Senior Program Manager Microsoft
July 12th, 2011 8:35pm

Hi Travis, i mean created by particular user. Krishna
Free Windows Admin Tool Kit Click here and download it now
July 12th, 2011 9:08pm

Latest blog post I have written on this topic: http://blogs.technet.com/b/servicemanager/archive/2011/07/13/using-smlets-beta-3-post-9-deleting-objects.aspxTravis Wright Senior Program Manager Microsoft
July 15th, 2011 8:09pm

Hello people Im not an expert in Powershell, but i have implemented a Service MAnager 2010sp1 in my company, i need to delete a dozen of incidents and CR from the first tests, but now after a year almost we are in a process of iso 20000 certification, and a i need to delete or hide some of that Incidents and change requests that were tests, what is the best way to do it? Regards
Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2011 2:02pm

See this blog post: http://blogs.technet.com/b/servicemanager/archive/2011/07/13/using-smlets-beta-3-post-9-deleting-objects.aspx or this one: http://blogs.technet.com/b/servicemanager/archive/2011/05/25/using-smlets-beta-3-post-7-deleting-any-object-in-the-ui.aspx Travis Wright Senior Program Manager Microsoft
September 2nd, 2011 3:44pm

Tks Travis it is working Best Regards
Free Windows Admin Tool Kit Click here and download it now
September 13th, 2011 5:36pm

Hi Travis Is there a way the incidents can be deleted by IR number?
September 14th, 2011 10:57am

Yes: Get-SCSMObject –Class (Get-SCSMClass –Name System.WorkItem.Incident$) –Filter “Id –eq IR1234”| Remove–SCSMObject –ForceTravis Wright Senior Program Manager Microsoft
Free Windows Admin Tool Kit Click here and download it now
September 15th, 2011 4:49pm

Is there a way to restore deleted incidents using power shell?
May 1st, 2013 4:02pm

Since you deleted the object/incident in its entirety from the SCSM CMDB, the only way to restore the incident would be a SQL database restore assuming you are running backups, you could do a redirected restore to a new database and get the specific incident object from there I suppose, because you probably dont want to restore the entire CMDB from backup over the existing DB unless you had a very serious malfunction.
Free Windows Admin Tool Kit Click here and download it now
May 2nd, 2013 2:24am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics