Print

Powershell Integration Guide

NetHelpDesk can run PowerShell scripts based on certain events. Parameters specified within the PowerShell script can be mapped to NetHelpDesk fields and the values of these fields passed into the script when run.

1. Pre-Requisites

In order to use this feature and for this guide to be relevant, the following criteria will need to be met:

  1. Your NetHelpDesk instance will need to be on version 11.70 or later. In order to check this you can go to N > Help > About NetHelpDesk, and to upgrade you can go to N > Help > Show Release Details.
  2. You will need to have the relevant knowledge of PowerShell.

2. Key Terms

Here are a few terms which are commonly used in this guide and in the application: • Script – Refers to a PowerShell script. The script is not stored within the NetHelpDesk database. Instead, a record is made in the NetHelpDesk database which stores the location of a pre-written PowerShell script.

3. Setting up the Integration

3.1 Integration Settings

From the NetHelpDesk windows client go to N > Setup > Main Configuration, and select Integrations from the Configuration menu.

Powershell 1

From the Integrations menu, click on PowerShell.

Powershell 2

The PowerShell settings screen will now be displayed. From this screen, you can enable the PowerShell Integration, or Create Scripts.

3.2 Creating Scripts

To create new scripts, click the ‘Create Scripts’ button on the PowerShell setup screen. From this screen, you can configure as many scripts as you would like in NetHelpDesk.

Powershell 3

Click the add button to create a new script.

Powershell 4
  1. Script Name- This is the name of the script in NetHelpDesk for your own reference. It does not link to the actual script in any way.
  2. File Location- This is the location of the PowerShell script in the folder structure. This location must be accessible to the user who is running the NHServer scheduled task on the NetHelpDesk application server.
  3. Type- There are two types of scripts available, action or approval. The type determines what specific behaviour within NetHelpDesk can trigger the script.
  4. Mapping Grid- This is where you can map a NetHelpDesk field to a parameter in the PowerShell script. When a script is triggered by either the approval or an action on a ticket, the value of the NetHelpDesk field for that ticket is passed as the parameter value when the script is executed.

3.2.1 Types of Script - Action

Any script which has a type of ‘Action’ can be configured to be executed as part of a standard action within NetHelpDesk. To configure this, go to N > Setup > Main Configuration > Actions. Either edit or create a new action, and set the system use to ‘Execute PowerShell Script’.

Powershell 5

This gives you the option to select a script as highlighted above. Now, whenever this action is completed, NetHelpDesk will execute the PowerShell script for you during the next NHServer scan.

3.2.2 Types of Script - Approval

Any script which has a type of ‘Approval’ can be configured to be executed whenever a specific step of an Approval process is completed. To configure this, go to N > Setup > Main Configuration > Change Management > Approval Processes (Setup Processes).

Either use a pre-determined approval process or create a new process. You will then need to edit/add a step. At the bottom of this edit screen, you can select a script to be executed when this step of the approval is accepted.

Powershell 6

3.3 Running the Scripts

The PowerShell scripts are run on the application server as part of the NHServer scheduled task. In order for the script to run successfully, the user running the scheduled task must have the relevant execute permissions on the scripts.

To check the result/output of a script, in Windows Explorer, go to %AppData% > NetHelpDesk > ClientLog > PowerShellScript.txt.


Our software is available on multiple platforms...

NetHelpDesk is available on a range of devices with industry-leading functionality available throughout.

  • Windows Phone

    Windows Phone

  • Android

    Android

  • iPhone

    iPhone

  • BlackBerry

    BlackBerry

  • Tablets

    Tablets

  • Windows

    Windows

Close

Cookie Policy

We use cookies to enhance your experience on our web site. By using our website or closing this message, you are agreeing to our Cookie Policy.