Script Library

Boost your management, troubleshoot, and remediation capabilities with scripts created by experts in the IT community.

<< Back to Script Library

Tag: azure

(30 Scripts)
Use Azure Log Analytics data to find AVD Session Hosts which have not hosted any user sessions in the given timeframe. This can include both those powered up, which will likely incur more cost, as well as those not powered up.
Requires previously saved credentials for Azure for the user that runs the script - these can be stored using a ControlUp script.
Version: 1.0.7  |   Created: 2024-02-07  |   Modified: 2024-02-25  |   Creator: Guy Leech  |   Downloads: 1
Reports or changes the host disk caching mode for the OS disk on an Azure VM.
With disk caching enabled, VMs can achieve higher levels of performance.
The VM does not need to be powered off and the change will have no noticeable effect on user's currently using that VM.
Version: 1.0.11  |   Created: 2023-11-28  |   Modified: 2024-01-26  |   Creator: Guy Leech  |   Downloads: 2
Retrieve Azure Advisor recommendations for the selected VM(s), the resource group containing the VM or the whole subscription.
Version: 1.0.4  |   Created: 2023-04-04  |   Modified: 2023-04-05  |   Creator: Guy Leech  |   Downloads: 9
Measure the time taken from when an end user attempts to launch an AVD session to when that remote session becomes available. Designed to be used with AVD VMs which have "Start VM on Connect" enabled via their parent Host Pool
Version: 1.1.12  |   Created: 2023-01-25  |   Modified: 2023-05-15  |   Creator: Guy Leech  |   Downloads: 8
Will show the state of accelerated networking on the network interfaces for a VM with the option to enable or disable it.
Not all VM sizes/SKUs support accelerated networking - an attempt to enable it where it is not supported witll result in an error.
Connectivity may be interrupted when the setting is changed.
Version: 1.0.3  |   Created: 2022-10-21  |   Modified: 2023-02-26  |   Creator: Guy Leech  |   Downloads: 8
This script will test the connected virtual network of the machine, and validate if required outbound communication to use RDP Shortpath for public networks is open.
Version: 1.1.3  |   Created: 2022-10-05  |   Modified: 2022-10-06  |   Creator: Ton de Vreede  |   Downloads: 9
Finds Azure resources, either for the resource group the VM the script is run against resides in or all resource groups in the subscription, that are not currently attached to a parent resource.

Note that Citrix MCS machine catalogs may have resources which are not currently assigned but will be assigned when a VM is created in that catalog so should not be removed.

The information returned should be cross referenced & checked to another source, such as the Azure portal, before any resources are deleted just because they feature in the output of this script.
Version: 3.8.21  |   Created: 2022-09-17  |   Modified: 2024-02-25  |   Creator: Guy Leech  |   Downloads: 39
Lists current service health events in the subscription.
Version: 1.0.2  |   Created: 2022-08-30  |   Modified: 2022-08-31  |   Creator: Guy Leech  |   Downloads: 18
Retrieve the list of all current Azure emerging issues and show those which are marked as impacting the locations which are used in the resource group or subscription for the selected VM
Version: 1.0.3  |   Created: 2022-08-30  |   Modified: 2022-08-31  |   Creator: Guy Leech  |   Downloads: 16
Uses data from the Azure Monitor API to find resources which have not got an entry in the logs in the given period which could mean that they have not been used in that time and be candidates for removal for simplifcation and cost reduction, depending on the resource type. Resources not directly in the logs, such as network interfaces, will be checked by looking for log entries for their parent VM.

Only resources within the same resource group as the chosen resource can be searched or all rescure groups for the tenant depending on the parameters passed.

The output can be sorted/grouped by any of the output columns.

Parameters to specifically include and/or exclude providers by regular expression are available.

Note that not all resources when used will generate an activity in the log so may be shown as no being used when they have actually been used in the given time period.
Version: 3.2.26  |   Created: 2022-08-01  |   Modified: 2024-02-25  |   Creator: Guy Leech  |   Downloads: 45
Works at the resource group which contains the VM the script is run against
Version: 2.1.11  |   Created: 2022-08-01  |   Modified: 2022-09-18  |   Creator: Guy Leech  |   Downloads: 22
Show the Azure activity logs for the last number of (fractional) days.
Options to just show entries for the chosen AZ resource, the resource group it is in or the whole subscription.
Version: 1.1.16  |   Created: 2022-06-30  |   Modified: 2022-08-31  |   Creator: Guy Leech  |   Downloads: 17
Create a number of Azure VMs using the selected machine as a template in terms of machine, disk sizes/types and network interfaces.
If the machine name contains # characters, these will be replaced, with leading zeroes, by the next available machine name
It does not clone or copy any disks other than any gallery image the original was built from.
If domain details are provided, it will attempt to join the given domain when creation is complete.
Multiple tags can be added in a comma separated list of the form Tag name=Tag text
Version: 1.4.23  |   Created: 2022-06-27  |   Modified: 2022-10-07  |   Creator: Guy Leech  |   Downloads: 4
Create the credential files (locally) required by the Citrix Cloud script actions.
Stored in %ALLUSERSPROFILE%ControlUpScriptingSupport but the client secret stored in the files can only be decrypted by the Windows user that created that file.
The files created contain the tenant id in the file name so that a single Windows user can have credential files for multiple tenants. Original Azure scripts did have this feature and the files contained the tenant id so only a single file can exist - this script creates both credential files so both new and old Azure script actions can be run.
The script willl overwrite any existing credential files for the user and tenant.
Version: 2.1.26  |   Created: 2022-02-24  |   Modified: 2024-01-26  |   Creator: Guy Leech  |   Downloads: 7
Create the credential files (locally) required by the Azure script actions.
Stored in %ALLUSERSPROFILE%ControlUpScriptingSupport but the client secret stored in the files can only be decrypted by the Windows user that created that file.
The files created contain the tenant id in the file name so that a single Windows user can have credential files for multiple tenants. Original Azure scripts did have this feature and the files contained the tenant id so only a single file can exist - this script creates both credential files so both new and old Azure script actions can be run.
The script willl overwrite any existing credential files for the user and tenant.
Version: 1.1.15  |   Created: 2022-02-24  |   Modified: 2022-03-09  |   Creator: Guy Leech  |   Downloads: 30
Change the type of disk assigned to the Azure VM. Valid disk types are:

Standard_LRS
Premium_LRS
StandardSSD_LRS
UltraSSD_LRS
Premium_ZRS
StandardSSD_ZRS

Note that costs of this VM once updated could be very different.
Version: 2.3.5  |   Created: 2022-01-19  |   Modified: 2022-03-17  |   Creator: Guy Leech  |   Downloads: 28
Get and display network info for specified Azure machine
Version: 3.9.16  |   Created: 2021-12-10  |   Modified: 2022-10-23  |   Creator: Guy Leech  |   Downloads: 92
Perform a power action.
A wait time of zero will not wait for the action to complete.
Version: 2.7.14  |   Created: 2021-11-25  |   Modified: 2022-03-17  |   Creator: Guy Leech  |   Downloads: 38
Change the size of the Azure VM. Specify the name, or partial name, of a VM size such as B2s but note that the name of the new size must be unique.
IF THE TARGET MACHINE IS ON THIS SCRIPT CAN TRIGGER A RESTART!

Note that costs of this VM once updated could be very different.
Version: 2.3.13  |   Created: 2021-11-09  |   Modified: 2022-03-17  |   Creator: Guy Leech  |   Downloads: 28
Add a public IP address if not already assisgned, launch mstsc to the public IP address, wait for mstsc to exit and then remove public IP address (if script assigned it)
Version: 4.2.14  |   Created: 2021-11-01  |   Modified: 2024-01-26  |   Creator: Guy Leech  |   Downloads: 74
Boot diagnostics must be enabled in order for screenshots of Azure VM consoles to be produced
Version: 2.5.9  |   Created: 2021-10-13  |   Modified: 2022-03-17  |   Creator: Guy Leech  |   Downloads: 15
Displays the console of the selected machine or stores the console image into a folder defined in the script action arguments
Version: 2.10.29  |   Created: 2021-09-17  |   Modified: 2022-03-17  |   Creator: Guy Leech  |   Downloads: 30
This Azure Script Based Action allows you to to retrieve detailed information on actual costs of selected VM in the Azure Subscription your Service Principal has access to.
README: https://support.controlup.com/hc/en-us/articles/360011378518#h_01EE8GMB35X9Y20MXV22N1GGE9
Version: 1.1.2  |   Created: 2020-12-25  |   Modified: 2020-12-27  |   Creator: Esther Barthel, MSc  |   Downloads: 72
This Azure Script Based Action allows you to to retrieve detailed information on actual and forecast costs of the Azure Subscription your Service Principal has access too.
README: https://support.controlup.com/hc/en-us/articles/360011378518#h_01EE8GMB35X9Y20MXV22N1GGE9
Version: 1.1.2  |   Created: 2020-12-06  |   Modified: 2020-12-13  |   Creator: Esther Barthel, MSc  |   Downloads: 40
This Azure Script Based Action allows you to to retrieve detailed information on actual and forecast costs of the Azure Subscription your Service Principal has access too.

README: https://support.controlup.com/hc/en-us/articles/360011378518#h_01EE8GMB35X9Y20MXV22N1GGE9
Version: 1.1.2  |   Created: 2020-12-06  |   Modified: 2020-12-13  |   Creator: Esther Barthel, MSc  |   Downloads: 60
Gets the AVD Sessions hosts in the same pool as the target machine/session.
Version: 2.4.8  |   Created: 2020-07-10  |   Modified: 2022-08-31  |   Creator: Esther Barthel, MSc  |   Downloads: 91
This AVD Script Based Action allows you to send a message to a user, logged on to a AVD Desktop or RemoteApp session.
Version: 2.4.7  |   Created: 2020-06-13  |   Modified: 2022-08-31  |   Creator: Esther Barthel, MSc  |   Downloads: 73
Sets the Drain mode of an AVD Session Host to True or False
Version: 2.4.10  |   Created: 2020-05-23  |   Modified: 2022-08-31  |   Creator: Esther Barthel, MSc  |   Downloads: 78
Get Azure Virtual Desktop Session Host information of the machine/session.
Version: 2.10.11  |   Created: 2020-05-19  |   Modified: 2022-08-31  |   Creator: Esther Barthel, MSc  |   Downloads: 119
Gets the details of the AVD Hostpool the target machine/session is in.
Requires credentials created with scrip AZ Store Azure Credentials
Version: 2.11.17  |   Created: 2020-05-18  |   Modified: 2022-08-31  |   Creator: Esther Barthel, MSc  |   Downloads: 124