HI All,
Can we pull the Network IP address, DNS and default gateway for the VM's from power cli for the specific lists of VM's? E.g. C:\temp\vmlist
thanks
vmk
Try like this.
It does require VMware Tools.
Select Name,
@{N='Cluster';E={(Get-Cluster -VM $_).Name}},
@{N='IP';E={$_.Guest.IPAddress -join '|'}},
@{N='Gateway';E={$_.ExtensionData.Guest.IpStack.IpRouteConfig.IpRoute.Gateway.IpAddress | where {$_ -ne $null}}},
@{N='DNS';E={$_.ExtensionData.Guest.IpStack.dnsconfig.ipaddress -join '|' }}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this.
It does require VMware Tools.
Select Name,
@{N='Cluster';E={(Get-Cluster -VM $_).Name}},
@{N='IP';E={$_.Guest.IPAddress -join '|'}},
@{N='Gateway';E={$_.ExtensionData.Guest.IpStack.IpRouteConfig.IpRoute.Gateway.IpAddress | where {$_ -ne $null}}},
@{N='DNS';E={$_.ExtensionData.Guest.IpStack.dnsconfig.ipaddress -join '|' }}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference