Q: How can I place data on the System Center Orchestrator data bus from a Windows PowerShell script within Orchestrator?

A: Most built-in activities in Orchestrator automatically publish data to the data bus that can be used by subsequent activities. However, PowerShell scripts running in a Run .Net Script activity don't automatically publish any variables created within the PowerShell. To publish variable content to the data bus from a PowerShell script, the Run .Net Script activity has to be configured to publish specific variables to the databus.

  1. Open the properties of the Run .Net Script activity.
  2. Select the Published Data tab.
  3. Click the Add... button.
  4. In the Name field, enter a name for the variable to be used on the data bus. In the Type, select the type of the data (e.g., String) and in the Variable name enter the name of the variable defined within the PowerShell script-- but do NOT type the leading $ of the variable. It's very common to use the same name on the data bus for the variable as the variable within the PowerShell. Click OK.
  5. Click OK to the properties.