VMware Cloud Community
mpaniak
Contributor
Contributor
Jump to solution

How to get VM Name knowing only Snapshot name

New to this site, PowerCLI, and PowerShell in general.  I run a command to determine what snapshots are out there (get-vm|get-snapshot) and it returns to me a list of snapshots out there but not what VM's they are on.  How can I find the VM a snapshot is on?

Thanks for the help in advance.

In Christ,

Michael

Tags (1)
1 Solution

Accepted Solutions
DZ1
Hot Shot
Hot Shot
Jump to solution

The 'VM' property of the snapshot would give it to you.  Adding to your example, it would be.  Get-VM | Get-Snapshot | Select VM

View solution in original post

4 Replies
jpsider
Expert
Expert
Jump to solution

What is your goal? Are you trying to find a vm based on a snapshot name? or list the snapshot(s) of each vm?  I think I am confused as to what you are starting with and what you are expecting the output to be.

Thanks.

Reply
0 Kudos
DZ1
Hot Shot
Hot Shot
Jump to solution

The 'VM' property of the snapshot would give it to you.  Adding to your example, it would be.  Get-VM | Get-Snapshot | Select VM

mpaniak
Contributor
Contributor
Jump to solution

Sometimes snapshots are named with no reference to the VM.  With our current storage needs, I can pull up a list of snapshots that are of a certain age and then ask if the snapshots can be deleted.  Having the VM for the particular Snapshot would help the research.

Reply
0 Kudos
mpaniak
Contributor
Contributor
Jump to solution

Thank you so much.  That was exactly what I was looking for.  Smiley Happy

Reply
0 Kudos