VMware Cloud Community
wilber822
Enthusiast
Enthusiast

Get-VM unable to get Guest OS in PowerCLI5.0

Good morning everyone,

I'm a newbie in PowerCLI, I wroten a script to get Guest OS of Windows Server 2008 VM as below:

$vm = (Get-Cluster -Name "TEST" | Get-VM * | Where-Object {$_.Guest.OSFullName -like "*Windows Server 2008*"})

I found this is only work for VMs which is hosted on ESX4.1, but not work for VMs which is hosted on ESXi5.0

My vCenter server is 5.0 latest version, PowerCLI is latest as well.

Maybe my description is not clearly, please try following way you probably can find same result, I attached my output:

Create a cluster with ESXi5.0 servers, and then create some virtual machine.

Create a cluster with ESX4.1 servers, and then create some virtual machine.

Try run following script for each cluster and compare the output:

$report= @()
$report =  Get-VM | Select-Object @{Name="VM Display Name"; Expression={$_.name}},@{Name="OS"; Expression={$_.guest.osfullname}}

$report

https://www.zhengwu.org
Tags (1)
0 Kudos
3 Replies
LucD
Leadership
Leadership

Are the VMware Tools installed and up to date on the VMs on the ESXi 5 servers ?


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

0 Kudos
wilber822
Enthusiast
Enthusiast

Sorry, I just saw this post.

Yes, all up to date. I have upgraded my version to esxi5.0u2, not sure how its going now. Never tried again.

https://www.zhengwu.org
0 Kudos
LucD
Leadership
Leadership

You could also upgrade to PowerCLI 5.1.

Let us know if the problem is still there.


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

0 Kudos