Quantcast
Channel: SCSM PowerShell Cmdlets
Viewing all articles
Browse latest Browse all 306

New Post: Does Get-SCSMIncident accept arrays for filtering?

$
0
0

Hi All,

I am trying to extract a set of data using get-scsmincident, and at the moment I am running the query below

 

ForEach ($call in $calls){ 
                          $inc2 = Get-SCSMIncident -ID $id -ComputerName d-sm01                   
                            
                           $call | add-member -type NoteProperty -name Inc -value $inc2.DisplayName
                           $call | add-member -type NoteProperty -name affected -value $inc2.affecteduser
                           $call | add-member -type NoteProperty -name Assigned -value $inc2.Assignedto
                           $call | add-member -type NoteProperty -name Scheduled -value $call.SourceObject.values.Item(11).value
                        }             

 

This all works well and good, but when this is run on larger sites where there could be 150+ calls it is not very efficiant as it has to run 150 seperate Get... queries.  Is there a way of searching for a group of ID's? - the group of ID's will come from another query earlier in the script.

Thanks in advancem,

Ed



Viewing all articles
Browse latest Browse all 306

Trending Articles