AVD-Collect - Azure Virtual Desktop Diagnostics and Logging
AVD-Collect is a handy PowerShell script created by Microsoft Customer Support Services to assist with troubleshooting and resolving issues with Azure Virtual Desktop (and Windows 365), by capturing Logs for analysis (which could then be passed to Microsoft or allow you to delve deeper) and running basic Diagnostics against some common known issues.
You can download this script from: https://aka.ms/avd-collect
There is no publically avaliable github repository for it currently, Microsoft will retain the latest version of the script at this link.
This script was NOT created by me and comes 'As/Is', this article is merely intended to share the script to assit others in their AVD troubleshooting.
This script is intended to help support Microsoft Customer Support with assisting customers, but was made publically accessible to assist with MS Support cases and Azure Virtual Desktop diagnostics. No data is automatically uploaded to Microsoft.
Please be aware that the script may change and include new functionality not part of this article, please review the Changelog and Readme of the script directly.
A lot of the information below is contained in the script readme (including a list of the extensive diagnostics and log locations) and changelog; however, I am supplying this article for reference and to help share this nifty tool.
Script pre-requisites
-
The script must be run with elevated permissions to collect all required data.
-
All collected data will be archived into a .zip file located in the same folder as the script itself.
-
As needed, run the script on AVD host VMs and/or Windows-based devices from where you connect to the AVD hosts.
-
When launched, the script will present the Microsoft Diagnostic Tools End User License Agreement (EULA). You need to accept the EULA before you can continue using the script.
-
If the script does not start, complaining about execution restrictions, then in an elevated PowerShell console run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force -Scope Process
Acceptance of the EULA will be stored in the registry under HKCU\Software\Microsoft\CESDiagnosticTools, and you will not be prompted again to accept it as long as the registry key is in place. You can also use the "-AcceptEula" command line parameter to accept the EULA silently. This is a per-user setting, so each user running the script will accept the EULA once.
Script scenarios
Core - suitable for troubleshooting issues that do not involve Profiles or Teams or MSIX App Attach
- Collects core troubleshooting data without including Profiles/FSLogix/OneDrive or Teams or MSIXAA related data
- Runs Diagnostics.
Core + Profiles - suitable for troubleshooting Profiles issues
- Collects all Core data
- Collects Profiles/FSLogix/OneDrive related information, as available
- Runs Diagnostics.
Core + Teams - suitable for troubleshooting Teams issues
- Collects all Core data
- Collects Teams related information, as available
- Runs Diagnostics.
Core + MSIX App Attach - suitable for troubleshooting MSIX App Attach issues
- Collects all Core data
- Collects MSIX App Attach related information, as available
- Runs Diagnostics.
Core + MSRA - suitable for troubleshooting Remote Assistance issues
- Collects all Core data
- Collects Remote Assistance related information, as available
- Runs Diagnostics.
Extended (all) - suitable for troubleshooting most issues, including Profiles/FSLogix/OneDrive, Teams and MSIX App Attach
- Collects all Core data
- Collects Profiles/FSLogix/OneDrive related information, as available
- Collects Microsoft Teams related information, as available
- Collects MSIX App Attach related information, as available
- Runs Diagnostics.