chrischrischris
Enthusiast
Enthusiast

How do I use PowerCLI to determine the exact Linux kernel version of a VM?

Jump to solution

Hi all,

How do I use PowerCLI to determine the exact Linux kernel version of a VM?

Thanks in advance!

-Chris

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

Do you have VMware Tools running in those VMs?

If yes, the Guest property will contain an indication if it is a Windows or Linux guest OS.

Based on that you can send a PowerShell or a Bash script to retrieve the exact guest OS version.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership

Do you have VMware Tools running in those VMs?

If yes, the Guest property will contain an indication if it is a Windows or Linux guest OS.

Based on that you can send a PowerShell or a Bash script to retrieve the exact guest OS version.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
chrischrischris
Enthusiast
Enthusiast

Thanks Luc!

Is there any way to execute commands through VMware Tools for those VMs that I do not have a valid login for?

Interestingly, I'm gathering this info for our security team!

0 Kudos
LucD
Leadership
Leadership

Not afaik, you will have to provide GuestCredential on the Invoke-VMScript cmdlet.

Or call the Invoke-VMScript with an account that also has rights inside the guest OS.

If you don't, this for example

Get-VM MyVM | Invoke-VMScript -ScriptType Bash -ScriptText "uname -a"

will fail with this type of error

sspi.png


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
chrischrischris
Enthusiast
Enthusiast

Thanks Luc!!

0 Kudos