Skip to main content

PowerShell API

The included PowerShell plugin provides a powerful way to extend the SCCM Manager with arbitrary functions. More information about the integration of the plugin can be found on the corresponding plugin page.

Example configuration

Script directory

Example: Call of a specific script with display of a dialog

Example: A certain user group should only see the scripts from the "MyGroupBasedScripts" directory

Example: Only remote scripts should be displayed

Example: Only remote scripts from a subdirectory should be displayed

Example: All scripts should be displayed

Example: Substitution variable and integration of a script into the context menu

Script directory

powershell_plugin_0_thumb_480_0.jpg

Example: 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

Eigenschaft Description
Assembly PowerShellPlugin
Name My test script
Icon Dummy.png
Argument {COMPUTERNAME}
SelectedComputer SingleWithPing
Function SHOW_MESSAGE
Parameter -Type=Remote -Script=Test.ps1 -AnyAdditionalParameter=Test
  • Assembly: PowerShellPlugin
  • Name: My test script
  • Icon: Dummy.png
  • Argument: {COMPUTERNAME}
  • SelectedComputer: SingleWithPing
  • Function: SHOW_MESSAGE
  • Parameter: -Type=Remote -Script=Test.ps1 -AnyAdditionalParameter=Test
Example: A certain user group should only see the scripts from the "MyGroupBasedScripts" directory

This directory must therefore be specified as an argument in the corresponding configuration. Since these scripts are neither in the remote nor in the local directory, the user may choose whether to execute the script remotely or locally (by default, a script is always executed remotely).

powershell_plugin_1_thumb_480_0.jpg


Example: Only remote scripts should be displayed

powershell_plugin_2_thumb_480_0.jpg

 
Example: Only remote scripts from a subdirectory should be displayed

powershell_plugin_3_thumb_480_0.jpg


Example: All scripts should be displayed

powershell_plugin_4_thumb_480_0.jpg


Example: Substitution variable and integration of a script into the context menu

The script chosen here serves only as a computer-related showcase.

a) Create new function group and set context menu flag 

powershell_plugin_5_thumb_480_0.jpg


b) Create new action, select Powershell plugin, define function and parameter, where the latter is a script inherent parameter and {COMPUTERNAME} is automatically replaced

powershell_plugin_6_thumb_480_0.jpg


c) After restarting the SCCM Manager, the new context menu entry is displayed and can be used accordingly

powershell_plugin_7_thumb_480_0.jpg

powershell_plugin_8_thumb_480_0.jpg