Skip to main content

PowerShell API

The included PowerShell plugin provides a powerful way to extend the SCCM Manager with custom functionality. For more information on integrating the plugin, please visit the plugin's page.

Example configuration

Script directory

Example: Calling a specific script and displaying a dialog box

Example: A specific user group should only see the scripts in 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: Placeholder variable and integration of a script into the context menu

Script directory

powershell_plugin_0_thumb_480_0.jpg

Example: Running a specific script that displays a dialog box

The script to be executed is located in the directory: {Installation path}\SCCM2012WebService\PS1\{Domain}\Custom\Remote\Test.ps1

Property 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 specific user group should only be able to see the scripts in the “MyGroupBasedScripts” directory

This directory must therefore be specified as an argument in the corresponding configuration. Since these scripts are located neither in the remote nor in the local directory, the user can choose whether to run the script remotely or locally (by default, a script is always run 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: Display all scripts

powershell_plugin_4_thumb_480_0.jpg


Example: Placeholder and adding a script to the context menu

The selected script is provided here solely as a computer-based example.

a) Create a new function group and set the context menu flag 

powershell_plugin_5_thumb_480_0.jpg


b) Create a new action, select the PowerShell plugin, define the function and parameters, where the latter is a script-specific parameter and {COMPUTERNAME} is automatically substituted 

powershell_plugin_6_thumb_480_0.jpg


c) After restarting SCCM Manager, the new context menu item will appear and be available for use 

powershell_plugin_7_thumb_480_0.jpg

powershell_plugin_8_thumb_480_0.jpg