need command line to test duplex status on windows NIC cards
this woud be for windows 7
I tried the following powershell command
get-wmiobject Win32_NetworkAdapter | foreach-object { get-wmiobject -namespace root/WMI -class MSNdis_macOptions -filter "InstanceName='$($_.Name)'"}
but I can't seem to get usable info from this.
powershell wmi duplex
add a comment |
this woud be for windows 7
I tried the following powershell command
get-wmiobject Win32_NetworkAdapter | foreach-object { get-wmiobject -namespace root/WMI -class MSNdis_macOptions -filter "InstanceName='$($_.Name)'"}
but I can't seem to get usable info from this.
powershell wmi duplex
1
See this related question. It doesn't look like this is something that is available via the Windows API. It is typically something only available at the NIC driver level. Perhaps your NIC manufacturer might have something available. This post also confirms that.
– heavyd
May 9 '14 at 21:14
add a comment |
this woud be for windows 7
I tried the following powershell command
get-wmiobject Win32_NetworkAdapter | foreach-object { get-wmiobject -namespace root/WMI -class MSNdis_macOptions -filter "InstanceName='$($_.Name)'"}
but I can't seem to get usable info from this.
powershell wmi duplex
this woud be for windows 7
I tried the following powershell command
get-wmiobject Win32_NetworkAdapter | foreach-object { get-wmiobject -namespace root/WMI -class MSNdis_macOptions -filter "InstanceName='$($_.Name)'"}
but I can't seem to get usable info from this.
powershell wmi duplex
powershell wmi duplex
asked May 9 '14 at 20:42
JackoJacko
11626
11626
1
See this related question. It doesn't look like this is something that is available via the Windows API. It is typically something only available at the NIC driver level. Perhaps your NIC manufacturer might have something available. This post also confirms that.
– heavyd
May 9 '14 at 21:14
add a comment |
1
See this related question. It doesn't look like this is something that is available via the Windows API. It is typically something only available at the NIC driver level. Perhaps your NIC manufacturer might have something available. This post also confirms that.
– heavyd
May 9 '14 at 21:14
1
1
See this related question. It doesn't look like this is something that is available via the Windows API. It is typically something only available at the NIC driver level. Perhaps your NIC manufacturer might have something available. This post also confirms that.
– heavyd
May 9 '14 at 21:14
See this related question. It doesn't look like this is something that is available via the Windows API. It is typically something only available at the NIC driver level. Perhaps your NIC manufacturer might have something available. This post also confirms that.
– heavyd
May 9 '14 at 21:14
add a comment |
1 Answer
1
active
oldest
votes
Since I don't have Windows 8 (and Get-NetAdapterAdvancedProperty
) I used this to get the Speed/Duplex:
Update: This was driving me crazy. I was getting various errors with keys not existing, and it turns out certain devices will not have a speed/duplex like USB passthrough and Microsoft Cluster device. I updated it to use the enum value of duplex and also cycle through all available NICs.
Also, the original wasn't looking at the registry on the target, rather the localhost.
Function Get-NICSpeedDuplex {
Param (
[String]$computer
)
$key = "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}"
gwmi -Class Win32_NetworkAdapterConfiguration -Computer $computer -Filter "IPEnabled='$true'" | % {
$suffix = $([String]$_.Index).PadLeft(4,"0")
#get remote registry value of speed/duplex
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer)
$service = $reg.OpenSubKey("$key\$suffix\Ndi").GetValue("Service")
If ($service -imatch "usb") {
# This USB device will not have a '*SpeedDuplex' key
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = "USB Device"
}
} ElseIf ($service -imatch "netft") {
# Microsoft Clustered Network will not have a '*SpeedDuplex' key
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = "Cluster Device"
}
} Else {
$speedduplex = $reg.OpenSubKey("$key\$suffix").GetValue("*SpeedDuplex")
$enums = "$key$suffixNdiParams*SpeedDuplexenum"
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = $reg.OpenSubKey($enums).GetValue($speedduplex)
}
}
}
}
It's a little clunky hardcoding that registry key, but it seems to work on my Windows 7 PC and remote servers (2003/2008/2012). From this article : "The subkey represents the class of network adapter devices that the system supports."
Output of the script:
PS C:> Get-NICSpeedDuplex "test-server-xx" | ft -auto
Speed/Duplex Device
------------ ------
Auto Negotiation vmxnet3 Ethernet Adapter
Auto Negotiation vmxnet3 Ethernet Adapter #4
Cluster Device Microsoft Failover Cluster Virtual Adapter
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f751783%2fneed-command-line-to-test-duplex-status-on-windows-nic-cards%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Since I don't have Windows 8 (and Get-NetAdapterAdvancedProperty
) I used this to get the Speed/Duplex:
Update: This was driving me crazy. I was getting various errors with keys not existing, and it turns out certain devices will not have a speed/duplex like USB passthrough and Microsoft Cluster device. I updated it to use the enum value of duplex and also cycle through all available NICs.
Also, the original wasn't looking at the registry on the target, rather the localhost.
Function Get-NICSpeedDuplex {
Param (
[String]$computer
)
$key = "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}"
gwmi -Class Win32_NetworkAdapterConfiguration -Computer $computer -Filter "IPEnabled='$true'" | % {
$suffix = $([String]$_.Index).PadLeft(4,"0")
#get remote registry value of speed/duplex
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer)
$service = $reg.OpenSubKey("$key\$suffix\Ndi").GetValue("Service")
If ($service -imatch "usb") {
# This USB device will not have a '*SpeedDuplex' key
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = "USB Device"
}
} ElseIf ($service -imatch "netft") {
# Microsoft Clustered Network will not have a '*SpeedDuplex' key
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = "Cluster Device"
}
} Else {
$speedduplex = $reg.OpenSubKey("$key\$suffix").GetValue("*SpeedDuplex")
$enums = "$key$suffixNdiParams*SpeedDuplexenum"
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = $reg.OpenSubKey($enums).GetValue($speedduplex)
}
}
}
}
It's a little clunky hardcoding that registry key, but it seems to work on my Windows 7 PC and remote servers (2003/2008/2012). From this article : "The subkey represents the class of network adapter devices that the system supports."
Output of the script:
PS C:> Get-NICSpeedDuplex "test-server-xx" | ft -auto
Speed/Duplex Device
------------ ------
Auto Negotiation vmxnet3 Ethernet Adapter
Auto Negotiation vmxnet3 Ethernet Adapter #4
Cluster Device Microsoft Failover Cluster Virtual Adapter
add a comment |
Since I don't have Windows 8 (and Get-NetAdapterAdvancedProperty
) I used this to get the Speed/Duplex:
Update: This was driving me crazy. I was getting various errors with keys not existing, and it turns out certain devices will not have a speed/duplex like USB passthrough and Microsoft Cluster device. I updated it to use the enum value of duplex and also cycle through all available NICs.
Also, the original wasn't looking at the registry on the target, rather the localhost.
Function Get-NICSpeedDuplex {
Param (
[String]$computer
)
$key = "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}"
gwmi -Class Win32_NetworkAdapterConfiguration -Computer $computer -Filter "IPEnabled='$true'" | % {
$suffix = $([String]$_.Index).PadLeft(4,"0")
#get remote registry value of speed/duplex
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer)
$service = $reg.OpenSubKey("$key\$suffix\Ndi").GetValue("Service")
If ($service -imatch "usb") {
# This USB device will not have a '*SpeedDuplex' key
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = "USB Device"
}
} ElseIf ($service -imatch "netft") {
# Microsoft Clustered Network will not have a '*SpeedDuplex' key
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = "Cluster Device"
}
} Else {
$speedduplex = $reg.OpenSubKey("$key\$suffix").GetValue("*SpeedDuplex")
$enums = "$key$suffixNdiParams*SpeedDuplexenum"
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = $reg.OpenSubKey($enums).GetValue($speedduplex)
}
}
}
}
It's a little clunky hardcoding that registry key, but it seems to work on my Windows 7 PC and remote servers (2003/2008/2012). From this article : "The subkey represents the class of network adapter devices that the system supports."
Output of the script:
PS C:> Get-NICSpeedDuplex "test-server-xx" | ft -auto
Speed/Duplex Device
------------ ------
Auto Negotiation vmxnet3 Ethernet Adapter
Auto Negotiation vmxnet3 Ethernet Adapter #4
Cluster Device Microsoft Failover Cluster Virtual Adapter
add a comment |
Since I don't have Windows 8 (and Get-NetAdapterAdvancedProperty
) I used this to get the Speed/Duplex:
Update: This was driving me crazy. I was getting various errors with keys not existing, and it turns out certain devices will not have a speed/duplex like USB passthrough and Microsoft Cluster device. I updated it to use the enum value of duplex and also cycle through all available NICs.
Also, the original wasn't looking at the registry on the target, rather the localhost.
Function Get-NICSpeedDuplex {
Param (
[String]$computer
)
$key = "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}"
gwmi -Class Win32_NetworkAdapterConfiguration -Computer $computer -Filter "IPEnabled='$true'" | % {
$suffix = $([String]$_.Index).PadLeft(4,"0")
#get remote registry value of speed/duplex
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer)
$service = $reg.OpenSubKey("$key\$suffix\Ndi").GetValue("Service")
If ($service -imatch "usb") {
# This USB device will not have a '*SpeedDuplex' key
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = "USB Device"
}
} ElseIf ($service -imatch "netft") {
# Microsoft Clustered Network will not have a '*SpeedDuplex' key
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = "Cluster Device"
}
} Else {
$speedduplex = $reg.OpenSubKey("$key\$suffix").GetValue("*SpeedDuplex")
$enums = "$key$suffixNdiParams*SpeedDuplexenum"
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = $reg.OpenSubKey($enums).GetValue($speedduplex)
}
}
}
}
It's a little clunky hardcoding that registry key, but it seems to work on my Windows 7 PC and remote servers (2003/2008/2012). From this article : "The subkey represents the class of network adapter devices that the system supports."
Output of the script:
PS C:> Get-NICSpeedDuplex "test-server-xx" | ft -auto
Speed/Duplex Device
------------ ------
Auto Negotiation vmxnet3 Ethernet Adapter
Auto Negotiation vmxnet3 Ethernet Adapter #4
Cluster Device Microsoft Failover Cluster Virtual Adapter
Since I don't have Windows 8 (and Get-NetAdapterAdvancedProperty
) I used this to get the Speed/Duplex:
Update: This was driving me crazy. I was getting various errors with keys not existing, and it turns out certain devices will not have a speed/duplex like USB passthrough and Microsoft Cluster device. I updated it to use the enum value of duplex and also cycle through all available NICs.
Also, the original wasn't looking at the registry on the target, rather the localhost.
Function Get-NICSpeedDuplex {
Param (
[String]$computer
)
$key = "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}"
gwmi -Class Win32_NetworkAdapterConfiguration -Computer $computer -Filter "IPEnabled='$true'" | % {
$suffix = $([String]$_.Index).PadLeft(4,"0")
#get remote registry value of speed/duplex
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer)
$service = $reg.OpenSubKey("$key\$suffix\Ndi").GetValue("Service")
If ($service -imatch "usb") {
# This USB device will not have a '*SpeedDuplex' key
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = "USB Device"
}
} ElseIf ($service -imatch "netft") {
# Microsoft Clustered Network will not have a '*SpeedDuplex' key
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = "Cluster Device"
}
} Else {
$speedduplex = $reg.OpenSubKey("$key\$suffix").GetValue("*SpeedDuplex")
$enums = "$key$suffixNdiParams*SpeedDuplexenum"
New-Object PSObject -Property @{
"Device" = $_.Description
"Speed/Duplex" = $reg.OpenSubKey($enums).GetValue($speedduplex)
}
}
}
}
It's a little clunky hardcoding that registry key, but it seems to work on my Windows 7 PC and remote servers (2003/2008/2012). From this article : "The subkey represents the class of network adapter devices that the system supports."
Output of the script:
PS C:> Get-NICSpeedDuplex "test-server-xx" | ft -auto
Speed/Duplex Device
------------ ------
Auto Negotiation vmxnet3 Ethernet Adapter
Auto Negotiation vmxnet3 Ethernet Adapter #4
Cluster Device Microsoft Failover Cluster Virtual Adapter
edited Dec 11 '14 at 22:48
answered Dec 11 '14 at 5:32
xXhRQ8sD2L7ZxXhRQ8sD2L7Z
23815
23815
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f751783%2fneed-command-line-to-test-duplex-status-on-windows-nic-cards%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
See this related question. It doesn't look like this is something that is available via the Windows API. It is typically something only available at the NIC driver level. Perhaps your NIC manufacturer might have something available. This post also confirms that.
– heavyd
May 9 '14 at 21:14