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

Created Unassigned: Calling SMLets within Orchestrator [11505]

$
0
0
I am hoping you can help me as I am pulling out the remaining hair I have trying to figure this out. I am using Orchestrator for escalation on Incidents but I am having an issue running SMLets via Orchestrator.

I am attempting to pull all incidents that do not have a user in the AssignedTo field using SMLets (Beta 4) Get-SCSMIncident. This works correctly when using Powershell directly and Import-Module SMLets from my workstation, runbook server and SCSM server, so I know SMLets is installed correctly. However, when I use it via Orchestrator (runbook tester) it comes up with no data. SMLets module correctly loads and does not give me an error and the other functions of the script work fine but the SMLets cmdlets give me no data. I tried using both .Net Script and the Powershell IP. Here is a copy of the code - $Incident is not getting any data.


Import-Module "C:\Program Files\Common Files\SMLets\SMLets.psd1" # --- I used “Import-Module SMLets” as well. ----
$smdefaultcomputer = 'scsmxxxx101'

$Incident = get-scsmincident
foreach($IR in $Incident){
if($IR.AssignedTo -eq $null){
$ID = $IR.ID
$AssignedTo = "FALSE"
}
else{
$AssignedTo = $IR.AssignedTo
$ID = $IR.ID
}

Write-Host "$AssignedTo,$ID"
}

Any help would be appreciated

Viewing all articles
Browse latest Browse all 306

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>