Start a Conversation

Unsolved

S

1 Message

1007

November 26th, 2019 11:00

Get LinkStatus of specific NIC using WinRM WSMAN?

Hello -

I am trying to get the status of a specific NIC using winrm/wsman.

I tried this command but it returns a bunch of text:

winrm e http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_NICStatistics -u: -p: -r:https:// /wsman -skipCNcheck -skipCACheck -encoding:utf-8 -a:basic

 

Is there a way to specify the NIC you want to look up?  Just want the NIC and the LinkStatus of up or down.

Thanks

August 2nd, 2020 00:00

Hi,

Greetings from dell.

with the information provided, to get link status of NIC in a server

we have simple powershell command
PS C:\Users\Administrator> Get-NetAdapter -physical

Name InterfaceDescription ifIndex Status MacAddress LinkSpeed

---- -------------------- ------- ------ ---------- ----
SLOT 7 Port 2 QLogic FastLinQ QL41262-DE 25GbE Ada... 12 Disconnected F4-E9-D4-78-9A-DB ...s
NIC2 Broadcom NetXtreme E-Series Advanced... 11 Up 58-8A-5A-EC-63-FD ...s
SLOT 7 Port 1 QLogic FastLinQ QL41262-DE 25GbE A...#2 10 Disconnected F4-E9-D4-78-9A-DA ...s
SLOT 6 Port 2 Broadcom NetXtreme Gigabit Ethernet #2 9 Disconnected 00-0A-F7-E6-07-29 ...s
SLOT 6 Port 1 Broadcom NetXtreme Gigabit Ethernet 7 Disconnected 00-0A-F7-E6-07-28 ...s
Ethernet Remote NDIS Compatible Device 6 Up 58-8A-5A-EC-64-0F ...s
NIC1 Broadcom NetXtreme E-Series Advanc...#2 5 Disconnected 58-8A-5A-EC-63-FC ...s

Here it displays clearly interface index and link status as well.
this is just to get the status, not going in detail to get any further data
hope this command helps!!

still more precise and concise command to check only for link status to be "up/down"
Get-NetAdapter -physical | where status -eq 'up'
PS C:\Users\Administrator> Get-NetAdapter -physical | where status -eq 'up'

Name InterfaceDescription ifIndex Status MacAddress Link Speed
---- -------------------- ------- ------ ---------- ----
NIC2 Broadcom NetXtreme E-Series Advanced... 11 Up 58-8A-5A-EC-63-FD ...s
Ethernet Remote NDIS Compatible Device 6 Up 58-8A-5A-EC-64-0F ...s


if in detail Information is required, then just giving the index and get the advance property
PS C:\Users\Administrator> Get-NetAdapter -InterfaceIndex 5 | Get-NetAdapterAdvancedProperty

Name DisplayName DisplayValue RegistryKeyword RegistryValue
---- ----------- ------------ --------------- -----
NIC1 Energy-Efficient Ethernet Enabled *EEE {1}
NIC1 Encapsulation Overhead 0 *EncapOverhead {0}
NIC1 Encapsulated Task Offload Enabled *Encapsate... {1}

pls check for this and let me know if helps.

Thanks

SirishaUmapathy

#IWork4Dell

 

No Events found!

Top