Created
July 17, 2021 08:19
-
-
Save norman-bauer/601596414eb0e6e91c297c3a0f7c68d6 to your computer and use it in GitHub Desktop.
This small snippet removes mounted media from all SCVMM VMs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-SCVirtualMachine | Foreach-Object { | |
$vm = $_; | |
$dvd = Get-SCVirtualDVDDrive -VM $vm; | |
if ($dvd.Connection -ne 'None' -and $dvd.Connection -ne $null) { | |
Set-SCVirtualDVDDrive -VirtualDVDDrive $dvd -NoMedia | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment