Get NIC speed using PowerCLI script
Connect-VIServer vcenterservername
$VMhosts = Get-VMHost | Get-View
Foreach ($vmhost in $vmhosts){
Write-Output $vmhost.Name
$pnic = 0
Do {
$Speed = $VMhost.Config.Network.Pnic[$pnic].LinkSpeed.SpeedMb
Write "Pnic$pnic $Speed"
$pnic ++
} Until ($pnic -eq ($VMhost.Config.Network.Pnic.Length))}
Connect-VIServer vcenterservername
$VMhosts = Get-VMHost | Get-View
Foreach ($vmhost in $vmhosts){
Write-Output $vmhost.Name
$pnic = 0
Do {
$Speed = $VMhost.Config.Network.Pnic[$pnic].LinkSpeed.SpeedMb
Write "Pnic$pnic $Speed"
$pnic ++
} Until ($pnic -eq ($VMhost.Config.Network.Pnic.Length))}
No comments:
Post a Comment