|
The Get-CDDrive will only return information when given a VM, Template, or SnapShot, so I think we will need more clarification on what you are looking for. Just issuing the Get-CDDrive command without any parameters does not return any results.
However, if you do a Get-VM | Get-CDDrive, you will want to look at the ID line. It should say something like "VirtualMachine-##/3000". The "##" will contain the ID number of the VM that the Drive is connected to. I am not sure if you can get that number from powershell, but I checked it using the VI API and the number (##) does correspond to the VM id number on my box. You can also find the ID number by using the MOB of your host server (https://server/mob) |
|
Borrowing from another post and the example in the VMWare blog beta announcement get-viserver vcserver.FQDN # provide your credentials when prompted | Get-VM | Get-CDDrive | ? { $_.ConnectionState.Connected -eq "true" } | Set-CDDrive -Connected:$false -Confirm:$false http://blogs.vmware.com/vipowershell/2008/03/we-are-beta.html |
|
Try this. It should also work for guests that more than 1 CD/DVD drive
|