QuickTip: Quick Check for VMs with CDDrives attached

Hey Everyone!!!

I just wanted to do a quicktip for how you can quickly check to see which of your VMs have CD Drives connected to them. YAY One-Liners!!!

“get-vm |Get-CDDRive | Where-Object {$_.connectionstate.connected -like $true} |Select parent, isopath, hostdevice, remotedevice”

This will check all your VMs with CDDrives connected

You might be surprised what you still have hanging around out there….

Sweet so you just found some VMs with CD Drives attached. What if  you want to disconnect them…

“Get-VM MyVM |Get-CDDrive \ Set-CDdrive -connected 0 -startconnected 0”

Above, you can simply change “MyVM” to the name of your VM or VMs’ CDDrives you want disconnected.

Hope this Helps! ALLONS-Y!

Leave a Reply