Scripted Event Documentation - Microsoft Teams for WVD

Contributors tvanroo Download PDF of this page

Overview

NetApp VDS includes a library of pre-defined scripted events that can be used directly in VDS environments and/or duplicated and used as the building blocks for custom scripted events.

For this application, this article covers both the install and uninstall action. For each of these two actions, there is a summary of the script and an example of an activity (trigger) that can be applied to implement the script.

This script package installs/uninstalls Microsoft Teams WVD using the Chocolatey package manager (https://chocolatey.org/) to do the deployment. Chocolatey is deployed by VDS when VMs are created but this script will also check and install Chocolatey as a prerequisite if it is missing.

This Microsoft Teams install is specifically configured for deployments into a WVD environment with customizations and components specific to WVD in Azure. A different Microsoft Teams script is provided for RDS deployments.

Install Script

Suggested Add Script Settings for Install

Built-in scripted events such as this one are pre-populated, can’t be edited and don’t need to be created. These "Suggested Add Script Settings" are simply for reference. To learn how to link this script to an activity, jump to the Suggested Add Activity Settings section below.
  • Name: Enter InstallMicrosoftTeamsWVD

  • Include Script File: Select Yes

  • Script File: Select script file and upload (InstallMicrosoftTeamsWVD.ps1)

  • Execute With: Enter C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe

Add Script Dialog Window Screenshot

scriptlibrary.script.InstallMicrosoftTeamsWVD

Suggested Add Activity Settings for Install

This example activity will install this application when the app is added to the Workspace in the VDS interface. VDS Scripted Events offers many other types of activity triggers such as "Create Server" which could be used as an alternative to the "Application Install" Event Type. Using "Create Server" would simply run this app install against all newly created VMs in VDS. "Create Server" and other triggers are documented and can be explored here.
In order for a script in the repository to take any action, an activity must be created to associate that script with a selected trigger. In this case, the activity will link the existing script to the Application Install trigger. Once configured, the action of adding this application to a workspace (from the Workspace > Applications page in VDS) will trigger this script to install this application on all appropriate session hosts in the selected deployment.
To create an Activity and link this script to an action:
  1. Navigate to the Scripted Events section in VDS

  2. Under Activities click + Add Activity

  3. In the opened dialog window enter the following information:

    • Name: Enter InstallMicrosoftTeamsWVD

    • Description: Optionally enter a description

    • Deployment Select the desired deployment from dropdown

    • Script: Select InstallMicrosoftTeamsWVD from the dropdown

    • Arguments: Leave blank

    • Enabled checkbox: Check the box

    • Event Type: Select Application Install from dropdown

    • Application: Select Microsoft Teams WVD from dropdown

    • Shortcut Path: Enter \\shortcut\Microsoft Teams WVD.lnk

Add Activity Dialog Window Screenshot

scriptlibrary.activity.InstallMicrosoftTeamsWVD

Uninstall Script

Suggested Add Script Settings for Uninstall

Built-in scripted events such as this one are pre-populated, can’t be edited and don’t need to be created. These "Suggested Add Script Settings" are simply for reference. To learn how to link this script to an activity, jump to the Suggested Add Activity Settings section below.
  • Name: Enter UninstallMicrosoftTeamsWVD

  • Include Script File: Select Yes

  • Script File: Select script file and upload (UninstallMicrosoftTeamsWVD.ps1)

  • Execute With: Enter C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe

Add Script Dialog Window Screenshot

scriptlibrary.script.UninstallMicrosoftTeamsWVD

Suggested Add Activity Settings for Uninstall

In order for a script in the repository to take any action, an activity must be created to associate that script with a selected trigger. In this case, the activity will link the existing script to the Application Install trigger. Once configured, the action of adding this application to a workspace (from the Workspace > Applications page in VDS) will trigger this script to install this application on all appropriate session hosts in the selected deployment.
To create an Activity and link this script to an action:
  1. Navigate to the Scripted Events section in VDS

  2. Under Activities click + Add Activity

  3. In the opened dialog window enter the following information:

    • Name: Enter UninstallMicrosoftTeamsWVD

    • Description: Optionally enter a description

    • Deployment Select the desired deployment from dropdown

    • Script: Select UninstallMicrosoftTeamsWVD from the dropdown

    • Arguments: Leave blank

    • Enabled checkbox: Check the box

    • Event Type: Select Application Uninstall from dropdown

    • Application: Select Microsoft Teams WVD from dropdown

    • Shortcut Path: Enter \\shortcut\Microsoft Teams WVD.lnk

Add Activity Dialog Window Screenshot

scriptlibrary.activity.UninstallMicrosoftTeamsWVD