Flapoly
Contributor
Contributor

Howto to know if a nic is configured as AutoNegotiate

Jump to solution

Hi all,

I would like to automatically check if all the nics of all ESXi are configured as AutoNegotiate

the Get-VMHostNetworkAdapter does not provide this information

Thks for help

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

Try this

Get-VMHost | Get-View | %{
	$esx = $_
	$_.Config.Network.Pnic | %{
		if(!$_.Spec.LinkSpeed){
			$auto = $true
		}
		else{
			$auto = $false
		}
		$row = "" | Select ESX, pNIC, Autonegotiate
		$row.ESX = $esx.Name
		$row.pNIC = $_.Device
		$row.Autonegotiate = $auto
		$row
	}
}

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
1 Reply
LucD
Leadership
Leadership

Try this

Get-VMHost | Get-View | %{
	$esx = $_
	$_.Config.Network.Pnic | %{
		if(!$_.Spec.LinkSpeed){
			$auto = $true
		}
		else{
			$auto = $false
		}
		$row = "" | Select ESX, pNIC, Autonegotiate
		$row.ESX = $esx.Name
		$row.pNIC = $_.Device
		$row.Autonegotiate = $auto
		$row
	}
}

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos