I am using powerCLI verion 5.5, and I wrote the following script:-
Get-VMHost |Export-Csv -Path c:\test.csv -NoTypeInformation –UseCulture
I got info for the vmhost such as used memory, build, state ,cpu spped, etc. but for the networkinfo section inside the generated .csv file I got "localhost" instead of the VMHost network info. so I wrote another script as follow to get the ip,mac and other netwrk info:-
(Get-VMHost).NetworkInfo | Export-Csv -Path c:\test2.csv -NoTypeInformation -UseCulture
but I got these info only , where I can not get the IP,MAC of the VMHOst :-
VMHostId VMHost VMKernelGateway VMKernelGatewayDevice ConsoleGateway ConsoleGatewayDevice DnsAddress DnsFromDhcp DnsDhcpDevice DomainName HostName SearchDomain VirtualSwitch PhysicalNic ConsoleNic VirtualNic Uid IPv6Enabled ConsoleV6Gateway ConsoleV6GatewayDevice VMKernelV6Gateway VMKernelV6GatewayDevice ExtensionData ExtensionData2
HostSystem-ha-host ******.intra 172.16.20.1 FALSE localhost VMware.VimAutomation.ViCore.Interop.V1.Host.Networking.VirtualSwitchInterop[] VMware.VimAutomation.ViCore.Interop.V1.Host.Networking.Nic.PhysicalNicInterop[] VMware.VimAutomation.ViCore.Interop.V1.Host.Networking.Nic.HostVirtualNicInterop[] VMware.VimAutomation.ViCore.Interop.V1.Host.Networking.Nic.HostVirtualNicInterop[] /VIServer=root@****************:443/VMHost=HostSystem-ha-host/VMHostNetwork=/ FALSE VMware.Vim.HostNetworkInfo VMware.Vim.HostNetworkSystem
so can anyone advice how I can get the network info the vmhost ? and should this be done as a separate script or I can do this inside my original script Get-VMHost ??