Hi All,
Below query is showing the VLAN ID of VM, how can i merge this my script
get-vm -Name SRMTEST | Get-VirtualPortGroup | sort Name | Select Name, @{N="VLANId";E={$_.Extensiondata.Config.DefaultPortCOnfig.Vlan.VlanId}}
How can I add the above line to below script....please help..
Get-VM TESTVM | Get-HardDisk |
Select @{N='VM Name';E={$_.Parent.Name}},
@{N="IP Address";E={[string]::Join(',',$_.Parent.guest.IPAddress)}}, #All IPs of VMs
@{N='HD Name';E={$_.Name}},
@{N='HD Capacity';E={$_.CapacityGB}}
This looks like a duplicate of 2. Re: Unable to get Port Group Name and VLAN ID for VMs
Was that answer not good ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi,
I am not able to get the VLAN details, it is shows blank.
Please help.
here the command that works for me:
get-vm -name "myvm" | Get-VirtualPortGroup | select Name, VLanId
Enviroment: vsphere 5.5 u2 and powercli 5.88 R1
But mine is a Distributed Switch,
get-vm -Name SRMTEST | Get-VirtualPortGroup | sort Name | Select Name, @{N="VLANId";E={$_.Extensiondata.Config.DefaultPortCOnfig.Vlan.VlanId}}
How can I add the above line to below script....please help..
Get-VM TESTVM | Get-HardDisk |
Select @{N='VM Name';E={$_.Parent.Name}},
@{N="IP Address";E={[string]::Join(',',$_.Parent.guest.IPAddress)}}, #All IPs of VMs
@{N='HD Name';E={$_.Name}},
@{N='HD Capacity';E={$_.CapacityGB}}