PowerCLI: Find VMs with Mounted ISO, Disconnect Mounted ISO

November 9, 2015

tags:
no comments
PowerCLI: Find VMs with Mounted ISO, Disconnect Mounted ISO

PowerCLI: Find VMs with Mounted ISO, Disconnect Mounted ISO

To get all VMs with ISO mounted, we going to using PowerCLI one-line script:

Get-VM | Get-CDDrive | select @{N="VM";E="Parent"},IsoPath | where {$_.IsoPath -ne $null}

 

Now, if we want to perform disconnect action for all VMs, we going to using PowerCLI one-line script:

Get-VM | Get-CDDrive | where {$_.IsoPath -ne $null} | Set-CDDrive -NoMedia -Confirm:$False
Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*