Execution of packages via Ivanti DSM

In the "Misc\Ivanti DSM Wrapper" subdirectory of the installation directory, you will find an exported DSM Package Template (DSM version 2019.1), which you can use if you want to distribute packages created using the Packaging PowerBench over your existing DSM infrastructure.

The advantage over simply calling "DeployApplication.exe" within an "ExecuteEx" or "RunAs" command is that you can use values of DSM variables, schema extensions, ODS variables and the DSM Client within your PPB scripts, just as you are used to from scripts that you call via "CallScript".

To use the template, first import it into your DSM environment. If you check "Reconstruct object path" during the import, you will find a new package template called "Call NWC Packaging PowerBench Script from Ivanti DSM (Template)" in the path "Global Software Library > Application Library > Application Templates" after the import wizard is completed.

Note: Version 2.0 of the Packaging PowerBench includes a new template that fixes some minor problems of the template from version 1.0. It is recommended to delete the existing template in DSM and import the template supplied with version 2.0 into DSM.

Note: If you are still using an older version of DSM and the import of the template therefore fails, you can duplicate the existing "System eScript Package Template" template, rename it accordingly and copy the contents of the DSM Wrapper template to the package directory.



Now you can create a new DSM Package based on this template by selecting the previously imported package template in the New eScript Package wizard.

To execute a package created with the Packaging PowerBench in this context, you only have to copy the complete PPB package including all subdirectories into the "Extern$" directory of the DSM package. The wrapper PowerShell script then calls the actual PPB at runtime.

To be able to access the DSM variables within the PPB script, switch to expert mode in the Packaging PowerBench (see Expert mode) and insert "Get-NiVar", "Set-NiVar" or the other PowerShell commands that retrieve data from DSM or set data there. These variables are then initialized and can be used like any other variable in your PPB package.

In the example of the following screenshot, the DSM variables %CurrentServer% and the values of the %InitialMACAddress% schema property or the %SystemMainte-nance.Schedule% configuration variable are read. They are then available in the PowerShell script.