How do I get a port group name from an port ID?
I have a list of port id´s and want to find the port groups name from this list.
You could do something like this.
Note that if you have multiple VDS, the same portId might be used on several of the VDS.
$ports = Get-VDSwitch | Get-VDPort
foreach($portId in $portIds){
$ports | where{$_.Key -eq $portId} | Select Key,Name,ConnectedEntity,Switch,Portgroup
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Are these on VSS or VDS switches?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
They are on dvs
You could do something like this.
Note that if you have multiple VDS, the same portId might be used on several of the VDS.
$ports = Get-VDSwitch | Get-VDPort
foreach($portId in $portIds){
$ports | where{$_.Key -eq $portId} | Select Key,Name,ConnectedEntity,Switch,Portgroup
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Just what I was looking for. Thanks.