VMware Cloud Community
vmCrack
Contributor
Contributor

PowerCLI command to search unregister VM or VMX file

     Hi,

Need some assistance to locate a lost unregistered VM and/or vmx file. The environment has numerous datastores and would not be feasible to manually search for it. I tried searching for a quick command, but all I get is scripts to locate all VMs and register it. I just want to find a lost VMX/Unregister VM.

Any help would be great.

Dave

0 Kudos
7 Replies
vmroyale
Immortal
Immortal

Note: Discussion successfully moved from VMware ESXi 5 to VMware vSphere™ PowerCLI

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
0 Kudos
RvdNieuwendijk
Leadership
Leadership

You will probably find a solution in Luc's blogpost http://www.lucd.info/2009/12/02/raiders-of-the-lost-vmx/

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
LucD
Leadership
Leadership

Have a look at VMX Raiders Revisited or the original Raiders of the Lost VMX


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

0 Kudos
vmCrack
Contributor
Contributor

I did find the mentioned site, but the script is used to register VMs. I just want to locate it Smiley Happy. I'm sure the function for the search is in the script. I'm not an expert powercli-er.

0 Kudos
LucD
Leadership
Leadership

You can do that with the original script, it has a WhatIf switch.

If you add that, the script will only list the VMX it finds


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

0 Kudos
vmCrack
Contributor
Contributor

Seems like this script scans for all lost .vmx. I'm just trying to find 1 particular vmx.

0 Kudos
LucD
Leadership
Leadership

Indeed it does. But you could do a search on the VMX files that are found for the specific one you are looking for.

With a Where-clause and a -match operator that shouldn't be too hard.


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

0 Kudos