We help IT Professionals succeed at work.

Need a Powershell script to disconnect .ISO's from all VM's in the cluster

I'm moving my ISO's from an old SAN to a new one and need to disconnect all the ISO's attached to any/all VM's first.  With that said, I need a Powershell script to make this happen.  Anyone got anything?  I'm not a Powershell guru by any measure.

vCenter Server Name = ATLVC4
LUN Name = ISO

Thanks.
Comment
Watch Question

Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Maen Abu-TabanjehNetwork Administrator, Network Consultant
Top Expert 2011
Commented:
VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017
Commented:
If you actually want a graphical way to complete this. and not too familiar with Powershell, scripts etc

I would recommend using the following, also VMware recommends the use of PowerCLI, which is PowerShell interface with vSphere-specific additions.

http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli

One of the simplest PowerCLI examples, and something which is actually extremely useful on its own, is the Get-VM cmdlet. Which lists VMs.

PowerCLI can be a bit overwhelming to use,  But it can be enhanced with a nice toolset and a library of preconfigured scripts to jump-start your mass changes, which is possible with PowerGUI



and

VMware Community Pack

then when you have the above, there is an Easy Graphical Option to complete a Query

VMs with CDROM Connected.

and then you can Select and Disconnect.

See below



 Disconnect CDROMS from VMs using ]VMware Community Pack

Author

Commented:
hanccocka,

VMware vSphere PowerCLI 4.1 must be installed before PowerGUI can be installed.  The download is located here:  http://downloads.vmware.com/d/details/sdkwin41/ZHAqYmRwJXdiZCV3Kg==

Thanks for the help guys!
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Yes, that is correct, thats the first URL I provided!