none
Orchestrator data bus does not see array from powershell

    Question

  • Thanks in advance to anyone that can help me with this issue.

    I am using SMLets to illustrate my problem I have over simplified my script to the bare essentials with only one line creating the problem (See 1 and 2 below).
    - In powershell (32 bit and 64 bit) they both work perfectly and return an array of 3 or 4 elements.  The types are confirmed as arrays.

    - In Orchestrator however the first example works but the second one does not.

    - Both examples are using SMLets, however one is using Get-SCSMClass and the other Get-SCSMObject. 

    - Is it possible this has something to do with the fact that Orchestrator does not run in 64 bit mode?

    - Could this be an issue with SMLets

    Here is a copy of my Run .Net Script (Powershell) Activity (with the script that does not work and published data)

    Thanks again for any possible help or leads

    Wednesday, July 31, 2013 5:01 PM

Answers

  • Thanks for the quick response Stefan.  Unfortunately it didn't work.  The good news is I just solved it.  It DID turn out to be Orchestrators inability to run in powershell 64 bit mode.  I found this very good article regarding Orchestrator and Integration packs for Active Directory, Exchange, and the full compliment of System Center Apps (SCCM, SCOM, SCVMM and Service Manager)

    http://www.miru.ch/2013/05/how-to-execute-64-bit-powershell-scripts-in-system-center-orchestrator/

    I was able to fix the problem by using one of the solutions (the PowerShell Integration Pack by Charles Joy was also a great fix)

    Function Get-SCSMStatus {$smdefaultcomputer = 'GIExxx.mydomain.net'
      Import-Module SMLets
      $ClassesArray = @()
      $Classes = Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.ServiceRequest$) -Filter "ID -Like SR50*"
      Foreach ($Class in $Classes) {
        $ClassesArray += $Class.DisplayName
        }
      $ClassesArray
    }
    $ClassesArray = Invoke-Command -ScriptBlock ${function:Get-SCSMStatus}

    • Marked as answer by Robert Hydell Thursday, August 01, 2013 2:43 AM
    Wednesday, July 31, 2013 8:28 PM

All replies

  • Hi,

    if you want the DisplayName and to trigger for each DisplayName..

    Does this work?

    ...

    ..

    foreach ($Class in $Classes) { $DisplayName = Class.DisplayName $ClassesArray += $DisplayName

    }

    Define DisplayName in Published Data.

    Regards,

    Stefan




    www.sc-orchestrator.eu , Blog sc-orchestrator.eu

    Wednesday, July 31, 2013 7:52 PM
  • Thanks for the quick response Stefan.  Unfortunately it didn't work.  The good news is I just solved it.  It DID turn out to be Orchestrators inability to run in powershell 64 bit mode.  I found this very good article regarding Orchestrator and Integration packs for Active Directory, Exchange, and the full compliment of System Center Apps (SCCM, SCOM, SCVMM and Service Manager)

    http://www.miru.ch/2013/05/how-to-execute-64-bit-powershell-scripts-in-system-center-orchestrator/

    I was able to fix the problem by using one of the solutions (the PowerShell Integration Pack by Charles Joy was also a great fix)

    Function Get-SCSMStatus {$smdefaultcomputer = 'GIExxx.mydomain.net'
      Import-Module SMLets
      $ClassesArray = @()
      $Classes = Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.ServiceRequest$) -Filter "ID -Like SR50*"
      Foreach ($Class in $Classes) {
        $ClassesArray += $Class.DisplayName
        }
      $ClassesArray
    }
    $ClassesArray = Invoke-Command -ScriptBlock ${function:Get-SCSMStatus}

    • Marked as answer by Robert Hydell Thursday, August 01, 2013 2:43 AM
    Wednesday, July 31, 2013 8:28 PM