Applies to: Nerdio Manager for MSP (NMM) v1.2.0+
Overview
Scripted Actions are a library of PowerShell scripts that can be run in either Azure or AVD Virtual Machines as another step for various tasks performed by Nerdio Manager for MSP.
There are two types of Scripted actions: Azure Runbooks (available in v1.4.0) and Windows Scripts (available in v1.2.0). Each differ by where they are run:
Getting Started
Scripted Actions are available at customer account level. First login to NMM, then login to the customer account and finally select Scripted Actions from the main menu.
Create a Scripted Action
Click "Add Scripted Action" button located at the bottom right of the Scripted Action Page.
The following Fields will be presented:
Name: The name displayed when selecting from the list of available scripted actions.
Description: Description for use within NMM. This only appears on the Scripted Actions page.
Tags: Used for searching and organization
Script Execution Mode: This will dictate how NMM will act when passing the scripted action(s) to the VM. NMM uses the "Custom Script" Extension to ultimately execute the PowerShell commands (read more here.) The extension needs to be installed and removed every time it is used, and will add to the total time to execute for each time it does. Some PowerShell scripts can be combined together and passed with a single run if they do not interfere with each other, saving time.
- Combined Marks the scripted action as one that can be combined safely with other scripted action. An example would be a scripts that adds a registry value.
- Individual Scripts that should be run on their own. An example is a long script with commonly used variable names or require a fresh PowerShell session.
- Individual with Restart Similar to Individual option, but will tell NMM to restart the VM after execution. These are generally used when installing software or altering windows in a manner that requires a restart to apply changes. (Windows Scripts Only)
- Script: The PowerShell code that will be executed. You can pass variables into this code that Nerdio will replace dynamically depending on where it is run. Hover over the info icon to see more details.
Choose the settings that work best for your script, and input PowerShell code to be executed in the Script section
Use a Scripted Action
Scripted Actions can be used as part of the following tasks:
VM Provisioning - Executed during the provisioning or re-imaging of Session Host VMs. Whenever a session host is created, either from scratch or during re-imaging (which is essentially re-building the VM), the scripted action will be preformed as a final step.
To apply custom scripts for these tasks, navigate to the Host Pools screen, click the Action menu and select Properties -> VM Deployment.
Run Command - Manually run a command against a host pool. Useful if you simply need to alter all the session hosts without fully re-imaging them. For example, a script to change a registry key.
This is done by going to Host Pools screen, click the Action menu and select Hosts -> Run command.
Default Nerdio Scripts
Every Nerdio installation will come with default scripted actions. These are commonly used scripts and examples that you can use or reference for your own scripts. Default scripts will have the "Nerdio" tag. You can not edit the default scripts. You must clone them in order to create an editable copy.
Default Windows Scripts
Name | Use Case | Recommended Target | Requires Customization* |
Install MS Teams | Convenient script to save time manually uninstalling and reinstalling teams. Also enables AVD Mode | Image VMs (preferred), Session Hosts | No |
Install MS 365 Office Apps | Convenient script to save time manually updating office apps | Image VMs | Yes - If the default list of apps installed is not desired |
Virtual Desktop Optimization | Optimize session hosts for better performance. Commonly used for Remote App Session hosts. | Session Hosts | Yes - By default many apps are removed, such as calculator. If this is undesired, edit them out of the script. |
Install Zoom VDI Client | Installs Zoom (VDI Version) | Image VMs | No |
Enable RDP Shortpath | Enables RDP Shortpath | Image VMs or Session Hosts | No |
Enable AVD Screen Capture Protection | Enables screen capture Protection. Also an example of how to use PowerShell to edit registry via scripted actions. | Image VMs or Session Hosts | No |
Grant user local admin rights | Adds user who is assigned to the personal desktop VM to the local admin group | Session Hosts | No |
Update Windows | Runs Windows 10 Updates | Image VMs | No |
Default Azure Runbooks
Name | Purpose | Requires Customization* |
Assign Public IP to VM | Allows VM to have a public IP | Yes - If Static IPs are required or naming scheme is undesired |
Enable Antimalware Extension | Adds anti-malware extension | Yes - If custom exclusions or scan settings times are needed |
Enable VM OS disk Encryption | Encrypts Disk with Keyvault | Yes - If using an existing key vault |
*This script is intended to be cloned and edited to suit your needs. It may run fine without alteration, but care should be taken to ensure that the default behavior is desired.
Comments
Please sign in to leave a comment.