PowerTip: Use PowerShell to Eject DVDs from Group of Virtual Machines

Doctor Scripto

Dr Scripto

Summary: Use Windows PowerShell to eject the DVDs from a group of virtual machines.

Hey, Scripting Guy! Question How can I eject any mounted DVDs from a group of virtual machines that are running Hyper-V in Windows Server 2012?

Hey, Scripting Guy! Answer Use the Set-VMDvdDrive cmdlet and set the path to $null:

$name = “Client1″,”Server1″,”Server2”

$name | Foreach {Set-VMDvdDrive -VMName $_ -Path $null}

Doctor Scripto
Dr Scripto

Scripter, PowerShell, vbScript, BAT, CMD

Follow Dr Scripto   

0 comments

    Leave a comment