Automation

 View Only
  • 1.  How to get VM Name knowing only Snapshot name

    Posted Sep 16, 2015 03:37 PM

    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



  • 2.  RE: How to get VM Name knowing only Snapshot name

    Posted Sep 16, 2015 03:39 PM

    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.



  • 3.  RE: How to get VM Name knowing only Snapshot name

    Posted Sep 16, 2015 03:48 PM

    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.



  • 4.  RE: How to get VM Name knowing only Snapshot name
    Best Answer

    Posted Sep 16, 2015 03:41 PM

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



  • 5.  RE: How to get VM Name knowing only Snapshot name

    Posted Sep 16, 2015 03:49 PM

    Thank you so much.  That was exactly what I was looking for.  :smileyhappy: