VMware Cloud Community
Shocko
Enthusiast
Enthusiast
Jump to solution

Retriev the UUID of a VM form the guest

Guys, windows guests with vmware tools installed. Any programmatic method (or otherwise) to get the UUID of the vm from the guest?

Reply
0 Kudos
1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal
Jump to solution

Not without permissions to and querying vCenter.

View solution in original post

Reply
0 Kudos
6 Replies
daphnissov
Immortal
Immortal
Jump to solution

Not without permissions to and querying vCenter.

Reply
0 Kudos
pd2017
Contributor
Contributor
Jump to solution

Easiest way would be to go to the host  through Vsphere web console, (assuming you have vsphere access) and then VM's tab.. This will show you the VM's on the host. from there right click in the grey area in the columns field where it shows state, status , space etc and select Show/Hide Columns. From there you can select UUID from the list..

Reply
0 Kudos
Shocko
Enthusiast
Enthusiast
Jump to solution

Hmm, just playing around and the UUID as seen in the vSphere web client is shown in the Win32_BIOS data from WMI in windows as the machine serial number but it seems that this might be the BIOS UID and not garunteed to be unique as per:

So I guess instanceUID is what I'm looking for and it's not available in guest Smiley Sad

Reply
0 Kudos
pd2017
Contributor
Contributor
Jump to solution

Use below commands

c:\wmic bios get name,serialnumber,version

c:\wmic csproduct get name,identifyingnumber,uuid

Reply
0 Kudos
Shocko
Enthusiast
Enthusiast
Jump to solution

Thanks not sure how this csproduct.UUID matches vcentre though?

Reply
0 Kudos
vbranden
Contributor
Contributor
Jump to solution

It seems that the serial number matches the bios uuid with some formatting

In powershell this works

([guid]((Get-WmiObject win32_bios).SerialNumber -replace "[\s-]","").Substring(6)).ToString()

Reply
0 Kudos