Guys, windows guests with vmware tools installed. Any programmatic method (or otherwise) to get the UUID of the vm from the guest?
Not without permissions to and querying vCenter.
Not without permissions to and querying vCenter.
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..
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
Use below commands
c:\wmic bios get name,serialnumber,version
c:\wmic csproduct get name,identifyingnumber,uuid
Thanks not sure how this csproduct.UUID matches vcentre though?
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()