VMware Cloud Community
DanyB1
Contributor
Contributor

CD/DVD

how to see which VM has are Cd to connect with the VirtualCenter console

0 Kudos
1 Reply
sepeck
Contributor
Contributor

In the beta toolkit announcement on the blog, there was a code snippet that I use.

This will list them...

Connect-VIServer -server SERVER_NAME -protocol https ;
get-vm | where { $_ | get-cddrive | where { $_.ConnectionState.Connected -eq "true" } } | select Name;

This will disconnect them...

Connect-VIServer -server SERVER_NAME -protocol https ;
Get-VM | Get-CDDrive | where { $_.ConnectionState.Connected -eq "true" } | Set-CDDrive -Connected:$FALSE -Confirm:$FALSE

Because we have multiple environments where I work, I made a script with a menu.

Steven Peck

Message was edited by: sepeck -removed site specific names

0 Kudos