Wednesday, September 15, 2010

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

1 comment:

Vertie Martin said...

Based on your comments above, here are two articles which you might find helpful:
essay review