Does New-SCSMIncident return pointer to newly created incident?

Apr 24, 2011 at 12:05 AM

So I'm using new-SCSMIncident in a script and I want to attach a file to the newly created incident after it's created.  Does the New-SCSMIncident return any pointer to the newly created incident so I can use Set-SCSMIncident to attach a file?  Or is there a better way to do this?

Developer
Apr 24, 2011 at 9:04 AM

you should be able to use the -passthru parameter on new-SCSMIncident which will emit the incident when complete. 

Apr 25, 2011 at 5:26 AM

Yep, that worked. Thanks!

-Jeff.

From: jtruher [email removed]
Sent: Sunday, April 24, 2011 1:04 AM
To: ting@tingsys.com
Subject: Re: Does New-SCSMIncident return pointer to newly created incident? [smlets:255058]

From: jtruher

you should be able to use the -passthru parameter on new-SCSMIncident which will emit the incident when complete.

May 13, 2011 at 8:50 AM

thanks! "-passthru" - cool parameter!!! )))

Aug 26, 2011 at 4:39 AM

It's not returning any object for me (and the incidents gets created without any problems)... Am I doing something wrong?

PS C:\> New-SCSMIncident -Title "Test Passthru" -Description "This is a test" -Impact Low -Urgency Low-Classification Other -Computer "myserver" -PassThru

PS C:\>

Thanks!

Aug 26, 2011 at 5:45 AM

Here's what I used:

$incident = (New-SCSMIncident -computername $servername -Title $title -Description $description -Source "E-Mail" -Impact Low -Urgency Low -Classification "Other" -Passthru).Object

-Jeff.

Aug 26, 2011 at 4:05 PM

Works great! Thanks, Jeff!

Dec 7, 2011 at 1:43 PM

Hi, I´ve tried to do the same with the New-SCSMObject command, but doesn´t seem to return pointer to new object... has anyone been able to get the pointer to the object from the new-scsmobject command?

Thanks,

David