vite1
Contributor
Contributor

PowerCLI command that searches VMs that aren't in inventory Datastore search

I need a PowerCli command that will search for a specific VM on my datastores even if it's not in inventory.  Is there a way to do this as I'm trying to search for a VM that I know was backed up in DR backup however I'm not sure wich datastore it was backed up to.

Thanks in advance.

Tags (2)
0 Kudos
3 Replies
LucD
Leadership
Leadership

You could try the script from my Raiders of the Lost VMX post.

If you run that with the WhatIf parameter it will only list the VMX files it finds on a datastore.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
EdWilts
Expert
Expert

This is what's normally known as an orphan VM and if you search for tools that locate orphans, you've found one.  e.g. google for "powershell orphan vm".  There are dozens out there.

If you have powergui with the community powerpack installed, you've already got the tool.

.../Ed (VCP4, VCP5)
0 Kudos
vite1
Contributor
Contributor

Hi EdWilts,  I just downloaded it.  Great stuff!  I was just trying to track where the VDR backups were going as someone that set this system up didn't lable or comment the destination and it was hard to trace out.  This powerGui is great for locating the Orphaned VMDKs as the ctk.vmdk file is concidered orphaned along with the acual vm it backs up.  Thanks a lot.

0 Kudos