Using SMlets for classes other than the standard commands

Oct 1, 2012 at 4:08 PM

I am a complete newbie at Powershell, so please accept my apologies for this basic (I'm sure) question.

I need to be able to open closed tickets to make changes for reporting purposes. I am currently able to do this for Incidents with:

GET-SCSMIncident -ID IR9999 | SET-SCSMIncident -Status Active

However, I can't get my head around the documentation for the GET-SCSMObject cmdlet. What should the command be for this, and how do I determine the GUID for the class I'm attempting to update?


Jan 23, 2013 at 7:02 PM

Are you looking for information on how to update an incident using get-scsmobject, or what is the goal for using the get-scsmobject cmdlet?

To get the class, you'll want to run the following:

get-scsmclass -name system.workitem.incident | where {$_.displayname -eq "incident"}

Using this in the get-scsmobjet cmdlet:

get-scsmobject -class (get-scsmclass -name system.workitem.incident | where {$_.displayname -eq "incident"})

This will retrieve all incidents in the system.  If you want to filter on a specific IR, you'll want to add the filter switch:

get-scsmobject -class (get-scsmclass -name system.workitem.incident | where {$_.displayname -eq "incident"}) -filter "Id -eq IR9999"

Hope this helps!