VMware: Find Connected ISO’s
If you want to search your VMware estate to find VMs that have connected CD/DVD ISO files, then here are your best two options;
Option 1: Use PowerCLI
Whilst connected to your virtual infrastructure (Connect-VIServer) issue the following command;
1 |
Get-VM | FT Name, @{Label="ISO file"; Expression = { ($_ | Get-CDDrive).ISOPath }} |
Option 2: Use PowerCLI
If you don’t already have RVTools then get it downloaded! One of the many cool things it does, is show ISO data. (On the vCD tab).
Ejecting All Connected VMware ISO files.
If you want to eject all those ISO files you can use the following PowerCLI syntax;
1 |
Get-VM | Get-CDDrive | where {$_.IsoPath -ne $null} | Set-CDDrive -NoMedia -Confirm:$False |
This will not work if a VM is powered off, and you will see a “The operation is not allowed in the current state.” error.