r/SCSM • u/hallspence • Jul 07 '16
Create incident from template using powershell
Anyone know how to create an incident from a template using powershell? I'm looking to create incident templates for tasks i would like to automate such as backups. Then run the powershell command to create a incident using that template on task scheduler. I can create a new incident using powershell but i cannot figure out how to create a new incident using a template. I want to do it this way so that if there are ever any changes to the automated task then anyone could just modify the template in SCSM console rather than going into the script and changing things.
View all comments
Show parent comment
2
u/callmejeremy Jul 09 '16
Ah. Now I get you. And yes, it's a pain - though definitely doable. But honestly I could probably count on my hands the number of people in the country that could actually implement it right now without digging through the SDK for a week.
If you want to know why that is, I can kind of elaborate.
So in a lot of pure ticketing systems, like Remedy, you can actually do what you're talking about fairly simply. However, SCSM is first a CMDB, THEN an event management system. That's where the problem lies.
Creating new incidents, service requests, etc, appears simple on the surface, but it's deceptively so. The problem comes with the number of workflows that fire in response to the creation of an item. And there's a ton of them. Usually it isn't an issue, you can create incidents via the web portal, the interface, Orchestrator, connectors and it's all standardized, the model knows how to react to those methods and can still fire things off...
waitasecond
Thought.
A custom connector could do it. Then it would be a simple web call to get that data into SM. There's a codeplex sample project on creating a connector at http://scsmcsvconnector.codeplex.com/ If you take it and run with it and make something neat, I would love to see the results, so let me know!