Script to find Snapshots\RMDS\ISOs in VSphere

Script to get snapshots , RDMS, ISOs in vCenter

Within 5.5 where machines are going to be migrated from

Want to do a check on source VMs to make sure they don't have any local devices attached to them, whats best way to tabulate this list?

I also want to check snapshots, which i have completed using RVtools and script below

get-vm | get-snapshot | FT VM, SizeGB, Created, Name, Description (The figures tally up there is only 3 vms with snapshots)

Is there a best way to get list of RMDs, ISOs, from vCenter or through a script?
LVL 1
Indie101Asked:
Who is Participating?
 
Ajay ChananaMCSE-2003/08|RHCSA| VCP5/6 |vExpert2018Commented:
To Find RDM  check article. - https://kb.vmware.com/s/article/1005937

I understand ISO could be trouble  when you want to detach those. check the below script to find VM.

Get-VM | FT Name, @{Label="ISO file"; Expression = { ($_ | Get-CDDrive).ISOPath }}

Dismount ISO by below command.

Get-VM | Get-CDDrive | where {$_.IsoPath -ne $null} | Set-CDDrive -NoMedia -Confirm:$False
0
 
Indie101Author Commented:
Couldnt export it to csv so referenced https://communities-gbot.vmware.com/thread/572030 which worked fine

Get-VM | where {($_ | Get-CDDrive).ISOPath -ne $null}  | select Name, @{Label="ISO file"; Expression = { ($_ | Get-CDDrive).ISOPath }} | export-csv c:\temp\export-iso.csv -NoTypeInformation -UseCulture
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.