1. Spinpanel | Knowledge Base
  2. Spinpanel WorkSpace
  3. Configuring Spinpanel WorkSpace Policies

Configure Device and User Templates

Device and user templates can be configured by the partner using PowerShell scripts with parameters, that can easily be rolled out to multiple customers.

Device templates are executed as Administrator on the Windows 10 device (local system). User templates are executed using the rights of the logged in user.

  1. Select Solutions then WorkSpace from the left menu.
  2. Select Device or User templates
  3. Click Add to add a new template

WorkSpace7

PowerShell Structure

Spinpanel WorkSpace offers the option to assign a PowerShell script to a device or user (Create). It can apply a modification by altering parameters (Update) or execute a certain action when detaching the script from a device or user (Delete).

The three main functions: Function Provisioning-Create, Function Provisioning-Update, Function Provisioning-Delete are mandatory. Do not remove them from the final script.

PowerShell Settings

Device and user templates support variables. As partner you can declare variables. However, you can also use variables that will automatically be shown as input fields or choose fields for the WorkSpace user. WorkSpace supports both input and output variables, and both are available with each action. For example, it is possible to base an Update or Delete action on the output of a Create action.

WorkSpace8

Use the menu to add and modify settings

  1. Select Solutions then WorkSpace from the left menu.
  2. Select Device or User templates
  3. Click Add

Input Settings

Input settings are divided into groups to simplify the management of a large number of settings.

  1. Click Add Setting Group
  2. Enter a name for the Setting Group
  3. Click Save
  4. Select the pencil icon next to the just now created Setting Group
  5. Click Add
    1. Enter a name for the Setting
    2. Indicate whether this setting is Required, the user cannot assign the script to a Device or User until the Setting has a value.
    3. Define the Type
    4. Optionally, enter a Default value
    5. Optionally, define the setting as Read Only. The setting is visible to the user, but not adjustable.
  6. Click Save
  7. Repeat steps 5 and 6 to create additional Settings in the group.
  8. Click Save to return to the Setting Groups

Output Settings

Output settings are not divided into Setting Groups.

  1. Click Add Output Setting
    1. Enter a name for the Setting
    2. Define the Type
  2. Click Save
  3. Repeat steps 1 and 2 to create additional Settings

Enter a Policy name and click Save to save the Device or User template.

Using Settings in the PowerShell Script

Input and Output Settings are available in the objects $inputParams and $outputParams as depicted in the example below.

Function Provisioning-Create {

  [CmdletBinding(HelpUri="https://www.spinpanel.com/documentation#support")]

  param(

                 [Parameter(Mandatory=$False,

                 ValueFromPipeline=$False)]

                 [Object]

                 $inputParams,

                 [Parameter(Mandatory=$False,

                 ValueFromPipeline=$False)]

                 [Object]

                 $outputParams

  )

  BEGIN

               {

$LocalOutput = New-Item -Path $inputParams.Path -Name ` "testfile1.txt" -ItemType "file"    -Value "This is a text string."

                $outputParams.RemoteOutput = $LocalOutput

                Return $outputParams

               }

  PROCESS {}

  END {}

}