Q
Manage Learn to apply best practices and optimize your operations.

Call PowerShell scripts from System Center Orchestrator

System Center Orchestrator provides Run .Net Script activity, which can be used to call PowerShell scripts, but there are limitations you should know.

System Center Orchestrator is modular in design, but for uninitiated administrators, it may present some limitations....

Luckily, there are a couple easy workarounds.

You can customize a Runbook created in System Center Orchestrator to execute any program or command-line tasks on the destination system. The Runbook can be executed either in interactive or background mode.

All of the commands and applications you want to execute via Runbook need to be configured in Runbook Activity. To call PowerShell scripts with Runbook, use Run .Net Script activity in System Center Orchestrator, as shown in Figure A below:

The Run .Net Script window
Figure A. Configure scripts in the Run .Net Script window.

You'll be required to select a scripting language by clicking the Browse button. Then, copy and paste the script code in the Script box and click Finish to call PowerShell. You can configure other options, like adding a namespace for each .NET library you've configured in your code, references for each .NET library, and the published data configurations you usually use for other activities.

One limitation is that System Center Orchestrator doesn't allow configuring credentials associated with the executed PowerShell script. Instead, it will use the service account that's configured on the Runbook server. Similarly, Run .Net Script activity can only execute PowerShell scripts in 32-bit mode.

But that's easily addressed. If you need to call PowerShell scripts in 64-bit mode, you'll be required to use other techniques, such as the Invoke-Command method, which executes the PowerShell code directly on the Runbook server. For example, Invoke-Command --ComputerName Localhost --ScriptBlock {your code here} ensures that the PowerShell code runs in 64-bit mode.

This was last published in December 2017

Dig Deeper on Microsoft Hyper-V management

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What other limitations should admins be aware of when calling PowerShell?
Cancel

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close