CodingVMware

Powershell to disconnect CD and Floppy drives in ESX

This script will enumerate all VMs and disconnect all CDs and Floppy drives

get-cddrive -VM *  |where {$_.ISOPATH -ne $null}|set-cddrive  -nomedia -Confirm:$False
get-cddrive -VM * |where {$_.HOSTDevice -ne $null}|set-cddrive -nomedia -Confirm:$False

get-FloppyDrive -VM * |where {$_.FloppyImagePath -ne $null}|set-FloppyDrive -nomedia -Confirm:$False
get-FloppyDrive -VM * |where {$_.HOSTDevice -ne $null}|set-FloppyDrive -nomedia -Confirm:$False

2 thoughts on “Powershell to disconnect CD and Floppy drives in ESX

Leave a Reply

Your email address will not be published. Required fields are marked *