We have a weird issue about getting vms ip addresses with powercli.
Our Vcenter server version is 6.5.0 build 8024368. Vmware module details are below.
PS C:\Users\XXXXX> Get-Module -Name VMware.* -ListAvailable | Select-Object -Property Name,Version
Name Version
---- -------
VMware.DeployAutomation 6.7.0.8250345
VMware.ImageBuilder 6.7.0.8250345
VMware.PowerCLI 10.2.0.9372002
VMware.Vim 6.7.0.9288211
VMware.VimAutomation.Cis.Core 10.1.0.8377811
VMware.VimAutomation.Cloud 10.0.0.7893901
VMware.VimAutomation.Common 10.1.0.8342134
VMware.VimAutomation.Core 10.1.0.8344055
VMware.VimAutomation.HA 6.5.4.7567193
VMware.VimAutomation.HorizonView 7.5.0.8827468
VMware.VimAutomation.License 10.0.0.7893904
VMware.VimAutomation.Nsxt 10.2.0.9296602
VMware.VimAutomation.PCloud 10.0.0.7893924
VMware.VimAutomation.Sdk 10.1.0.8342078
VMware.VimAutomation.Srm 10.0.0.7893900
VMware.VimAutomation.Storage 10.1.0.8313015
VMware.VimAutomation.StorageUtility 1.2.0.0
VMware.VimAutomation.Vds 10.1.0.8344219
VMware.VimAutomation.Vmc 10.0.0.7893902
VMware.VimAutomation.vROps 10.0.0.7893921
VMware.VumAutomation 6.5.1.7862888
Problem is; I can't read IP address information of Vms but one of my colleague can read it.
PS C:\Users\gokhan.acar> get-vm XXXXXX | Get-VMGuest
State IPAddress OSFullName
----- --------- ----------
Running {} Microsoft Windows Server 2016 (64-bit)
Is someone faced this issue?
Did you also try like this?
Get-VM | Select Name,
@{N='IPAddress';E={$_.Guest.IPAddress -join '|'}}
Do you and your colleague have the same role/privileges on that VM?
Check with
$vm = Get-VM -Name MyVM
$account1 = 'account1'
$account2 = 'account2'
$si = Get-View ServiceInstance -Server $global:DefaultVIServer
$authMgr = Get-View -Id $si.Content.AuthorizationManager -Server $global:DefaultVIServer
$p1 = $authMgr.FetchUserPrivilegeOnEntities($vm.ExtensionData.MoRef,$account1)
$p2 = $authMgr.FetchUserPrivilegeOnEntities($vm.ExtensionData.MoRef,$account2)
Compare-Object -ReferenceObject $p1[0].Privileges -DifferenceObject $p2[0].Privileges
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hello,
We are connecting with same user. Only difference is computer.
And also I have copied powercli module files to my computer but no luck.
So it's in fact a difference in output between 2 stations?
That could indicate that the installation on one of the stations is not correct.
Are you sure that all old PowerCLI installations are removed?
Is there something still left in Programs and Features?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I installed fresh windows 10 vm and test getting ip. But same result.
I can not find difference between two stations.
Is there a dependancy of any application?
Ok, so you have the same issue on a fresh Win10 station with a fresh PowerCLI installation.
Did you do that PowerCLI installation with Install-Module, or did you copy the files from another station?
And no, besides PowerShell and the .Net version, there is no dependency on another application.
Are the PowerShell and .Net versions the same on all stations?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference