Skip to content

Month: April 2023

Powershell command to Identify the Virtual Machine with CDROM Connect

Keeping CDROMs plugged into Virtual Machines can inhibit DRS/vMotion from working well for these Virtual Machines, as such it is best practice to remove CDROMs when not needed, so follow the commands to identify them.

List all Virtual Machine with CDROM connect:

Get-VM | Get-CDDrive | Where {$_.extensiondata.connectable.connected -eq $true} | Select Parent

Disconnect all CDROM from all Virtual Machine

Get-VM | Get-CDDrive | Where {$_.extensiondata.connectable.connected -eq $true} | Set-CDDrive -NoMedia -confirm:$false