none
Get UUID from VM? how

    Question

  • get-vm -Name "Win7" | Select-Object id

    above command give me and ID but that not the UUID how do i get it from the Hyper-V Manager? or shell

    #LnQ¯\_(ツ)_/¯

    Tuesday, March 14, 2017 10:52 AM

Answers

  • If you're talking about the BIOS UUID of the virtual machine, that is not exposed by Hyper-V Manager or the native PowerShell cmdlets. You must dig it out of WMI. Here's one way:

    get-vm "Win7" | % { (gwmi -Namespace root\virtualization\v2 -Class msvm_computersystem -Filter ('ElementName="{0}"' -f $_.Name)).GetRelated('msvm_virtualsystemsettingdata') | select BIOSGUID }


    Eric Siron
    Altaro Hyper-V Blog
    I am an independent contributor, not an Altaro employee. I accept all responsibility for the content of my posts. You accept all responsibility for any actions that you take based on the content of my posts.

    • Marked as answer by LongQuo Tuesday, March 14, 2017 7:54 PM
    Tuesday, March 14, 2017 1:22 PM

All replies

  • What ID are you looking for?  You are retrieving the VM's UUID from Hyper-V, so we need to know why that is not the one you are looking for.

    . : | : . : | : . tim

    Tuesday, March 14, 2017 12:39 PM
  • If you're talking about the BIOS UUID of the virtual machine, that is not exposed by Hyper-V Manager or the native PowerShell cmdlets. You must dig it out of WMI. Here's one way:

    get-vm "Win7" | % { (gwmi -Namespace root\virtualization\v2 -Class msvm_computersystem -Filter ('ElementName="{0}"' -f $_.Name)).GetRelated('msvm_virtualsystemsettingdata') | select BIOSGUID }


    Eric Siron
    Altaro Hyper-V Blog
    I am an independent contributor, not an Altaro employee. I accept all responsibility for the content of my posts. You accept all responsibility for any actions that you take based on the content of my posts.

    • Marked as answer by LongQuo Tuesday, March 14, 2017 7:54 PM
    Tuesday, March 14, 2017 1:22 PM
  • yes...i booted a cmd up and use this to get the UUID for pxe deployment

    wmic path win32_computersystemproduct get uuid



    #LnQ¯\_(ツ)_/¯

    Tuesday, March 14, 2017 7:55 PM