How to find the ID of Disks being used in Azure hosted MCS Catalogues
book
Article ID: CTX316433
calendar_today
Updated On:
Description
You might see a lot of disks or snapshots and wonder if which ones are being used by MCS catalogs. You might be thinking that you want to clear out un-used or un-needed disks. How can you tell which disks are being used?
Instructions
Find the disk ID using Get-ProvVM.
From an elevated Powershell prompt, load the Citrix snapins: add-pssnapin Citrix*
- Check the disk ID for one virtual machine:
Get-ProvVM -VMName <The name of the VM in the hypervisor context>
In the sample below, the catalog is hosted in Azure, the machine name is NOMCSIO and the redacted text is the Azure SubscriptionID. See the values returned for AssignedImage and BootedImage includes the name of the snapshot.

For the sample, see here in Azure Snapshots, the exact snapshot that is being used by the MCS catalogue:
- For a report showing all the images for all the machines in a single machine catalogue, try this report:
Get-ProvVM -ProvisioningSchemeName <The name of the MCS catalogue> | Select VMName,AssignedImage,BootedImage | export-csv c:\temp\MCS-diskIDs.csv
- For a report showing all the images for all the machines in all the MCS catalogue, try this report:
Get-ProvVM -ProvisioningSchemeName <The name of the MCS catalogue> | Select ProvisioningSchemeName,VMName,AssignedImage,BootedImage | export-csv c:\temp\MCS-diskIDs.csv
This will work from PowerShell on a DDC in an on-premise deployment or from the
Remote Powershell in a Citrix Virtual Apps and Desktop Services (cloud) deployment.
Environment
The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.
Issue/Introduction
This will work from PowerShell on a DDC in an on-premise deployment or from the Remote Powershell in a Citrix Virtual Apps and Desktop Services (cloud) deployment.
Additional Information
Citrix Remote Powershell SDK: https://developer-docs.citrix.com/projects/citrix-virtual-apps-desktops-service-sdk/en/latest/?_ga=2.148361727.937437493.1621417223-1260323513.1599842504#citrix-virtual-apps-and-desktops-service-sdk
Get-ProvVM: https://developer-docs.citrix.com/projects/citrix-virtual-apps-desktops-sdk/en/latest/MachineCreation/Get-ProvVM/
List snapshots in an Azure subscription: https://docs.microsoft.com/en-us/rest/api/compute/snapshots/list
Was this article helpful?
thumb_up
Yes
thumb_down
No