Skip to main content

Power Shell

This can be used to run any PowerShell scripts, locally on the server or on remote clients.

PowerShellW10.png

Configuration - Plugin-integration
  • Assembly: PowerShellPlugin
  • Name: RUN_POWERSHELL_SCRIPT (is translated)
  • Icon: scroll_run.png

The call of the Power Shell plug-in can be configured differently. Thus, it is possible to include the plug-in multiple times, with different configurations and permissions. Each configuration can contain the call of any script. For the representation of script collections e.g. for certain user groups each configuration can point to any script directory. Any number of subdirectories are possible. This allows granular rights distribution to specific AD groups. Additionally the plugin supports the replacement variable {COMPUTERNAME} within the function parameters for the execution of single scripts. Some configuration examples are shown below.

Supported functions (Function)
  • ALLOW_REMOVE_FROM_COLLECTION: If this function is selected, the entry for removing a computer object from the respective collection appears in the context menu.
Configuration - Global
  • EXECUTE: Only a message about success or failure is output.
  • GET_RESULT: The script result is displayed in a text box.
  • GET_DATATABLE: The script result is tried to be displayed in a table.
  • SHOW_MESSAGE: The script result is output as a dialog.
  • SHOW_SELECTABLE_MESSAGE: The script result is output as a dialog. However, the text content is selectable.

When using a function, the following parameters must also be specified.

  • -Type=Local or Remote

  • -Script=ScriptName.ps1

In addition, any other parameters that are expected by the respective script can be specified.

The scripts to be executed must be placed in the WebService directory under PS1\{domain}\Custom\Local or Remote.

Example configuration

Call of a specific script with display of a dialog

The script to run is located in the directory: {installation path}\SCCM2012WebService\PS1\{domain}\Custom\Remote\Test.ps1

  • Assembly: PowerShellPlugin
  • Name: Mein Testskript
  • Icon: Dummy.png
  • Argument: {COMPUTERNAME}
  • SelectedComputer: SingleWithPing
  • Function: SHOW_MESSAGE
  • Parameter: -Type=Remote -Script=Test.ps1 -AnyAdditionalParameter=Test

More sample configurations can be found at PowerShell API.