How to get all the network names of a VM using powershell
A开发者_如何学运维m new to powershell.I have to get the names of all network a VM can connect to.So, please can anyone help me out.
If your using Hyper-V you can try to install PowerShell Management Library for Hyper-V http://pshyperv.codeplex.com/ Or you have to find a WMI you can use Get-WmiObject win32_NetworkAdapter
In PowerCLI, you can use the Get-VirtualPortGroup command:
Get-VirtualPortGroup ESXi.FQDN.local
Name Key VirtualSwitch VLanId
---- --- ------------- ------
VM Network key-vim.host.PortGroup-VM N... vSwitch0 0
Management Network key-vim.host.PortGroup-Mana... vSwitch0 0
精彩评论