November 06, 2019

List VMWare VM's with attached ISO's

Problem: I need to find all VM’s with ISO’s attached to the virtual CD-Roms.

Prerequisite: VMWare PowerCLI for PowerShell

Solution:

$vCenter = "YOURVCENTERHOSTNAME"
Import-Module VMware.VimAutomation.Core | Out-Null
Connect-VIServer -Server $vCenter | Out-Null

#The actual working code to list attached ISO's
Get-VM | Get-CDDrive | Where-Object { $_.IsoPath -ne $null } | Select-Object Parent, IsoPath | Format-Table -auto

Disconnect-VIServer * -Confirm:$false -Force -ErrorAction SilentlyContinue

Good Luck!!!

& Thank you to Adil Arif & Brian Graf : http://www.enterprisedaddy.com/2016/04/powercli-find-iso-attached-virtual-machines/


Please consider crypto tipping:
  

No comments:

Post a Comment

Comments, Suggestions or "Thank you's" Invited! If you have used this info in any way, please comment below and link/link-back to your project (if applicable). Please Share.
I accept Bitcoin tips of ANY amount to: 1GS3XWJCTWU7fnM4vfzerrVAxmnMFnhysL
I accept Litecoin tips of ANY amount to: LTBvVxRdv2Lz9T41UzqNrAVVNw4wz3kKYk