Win32_NetworkAdapter

Win32 Network Adapter
root/cimv2dynamickey : DeviceID

Describes the Win32_NetworkAdapterWMI class, which represents a network adapter of a computer running a Windows operating system.

On this page

Main example

List instances

# All instances of Win32_NetworkAdapter, with the main properties
Get-CimInstance -ClassName Win32_NetworkAdapter |
    Select-Object -Property @(
        'DeviceID'
        'Description'
        'Status'
        'Manufacturer'
        'InstallDate'
        'MACAddress'
        'ServiceName'
    )

Examples

Filter with WQL

# WQL filter evaluated by the provider: AdapterTypeID = 4 (LocalTalk)
Get-CimInstance -ClassName Win32_NetworkAdapter -Filter 'AdapterTypeID = 4' |
    Select-Object -Property @(
        'DeviceID'
        'Description'
        'Status'
        'Manufacturer'
        'InstallDate'
        'MACAddress'
        'ServiceName'
    )

The filter is evaluated by the WMI provider: less data is transferred than with Where-Object.

Decode numeric values

# Lookup table for AdapterTypeID (values documented by Microsoft)
$adapterTypeIDName = @{
    0 = 'Ethernet 802.3'
    1 = 'Token Ring 802.5'
    2 = 'Fiber Distributed Data Interface (FDDI)'
    3 = 'Wide Area Network (WAN)'
    4 = 'LocalTalk'
    5 = 'Ethernet using DIX header format'
    6 = 'ARCNET'
    7 = 'ARCNET (878.2)'
    8 = 'ATM'
    9 = 'Wireless'
    10 = 'Infrared Wireless'
    11 = 'Bpc'
    12 = 'CoWan'
    13 = '1394'
}
# Lookup table for Availability (values documented by Microsoft)
$availabilityName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Running/Full Power'
    4 = 'Warning'
    5 = 'In Test'
    6 = 'Not Applicable'
    7 = 'Power Off'
    8 = 'Off Line'
    9 = 'Off Duty'
    10 = 'Degraded'
    11 = 'Not Installed'
    12 = 'Install Error'
    13 = 'Power Save - Unknown'
    14 = 'Power Save - Low Power Mode'
    15 = 'Power Save - Standby'
    16 = 'Power Cycle'
    17 = 'Power Save - Warning'
    18 = 'Paused'
    19 = 'Not Ready'
    20 = 'Not Configured'
    21 = 'Quiesced'
}

Get-CimInstance -ClassName Win32_NetworkAdapter |
    Select-Object -Property @(
        'DeviceID'
        'Description'
        'Status'
        'Manufacturer'
        'InstallDate'
        'MACAddress'
        'ServiceName'
    )

Query a remote computer (CIM session)

review before running
# Name of the remote computer
$computerName = 'SERVER01'
# The CIM session (WSMan by default) can be reused for several queries
$cimSession = New-CimSession -ComputerName $computerName
try {
    Get-CimInstance -CimSession $cimSession -ClassName Win32_NetworkAdapter |
        Select-Object -Property @(
            'DeviceID'
            'Description'
            'Status'
            'Manufacturer'
            'InstallDate'
            'MACAddress'
            'ServiceName'
        )
} finally {
    Remove-CimSession -CimSession $cimSession
}

WSMan (WinRM) is used by default. For a host without WinRM, create the session with -SessionOption (New-CimSessionOption -Protocol Dcom). Add -Credential to use another account.

Show the class structure

# Class structure: properties, types and flags (Key, ReadOnly…)
$cimClass = Get-CimClass -ClassName Win32_NetworkAdapter
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

# Methods of the class
$cimClass.CimClassMethods |
    Select-Object -Property Name, ReturnType

Properties

40 of 40 properties
NameTypeAccessDescription
AdapterTypestringread

Network medium in use. The network adapters are as follows:

Values (14)
ValueLabelDescription
Ethernet 802.3Ethernet 802.3
Token Ring 802.5Token Ring 802.5
Fiber Distributed Data Interface (FDDI)Fiber Distributed Data Interface (FDDI)
Wide Area Network (WAN)Wide Area Network (WAN)
LocalTalkLocalTalk
Ethernet using DIX header formatEthernet using DIX header format
ARCNETARCNET
ARCNET (878.2)ARCNET (878.2)
ATMATM
WirelessWireless
Infrared WirelessInfrared Wireless
BpcBpc
CoWanCoWan
13941394
Code
# Value of AdapterType for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, AdapterType |
    Select-Object -Property DeviceID, AdapterType
AdapterTypeIDuint16read

Network medium in use. Returns the same information as the AdapterType property, except that the information is in the form of an integer.

Values (14)
ValueLabelDescription
0Ethernet 802.3
1Token Ring 802.5
2Fiber Distributed Data Interface (FDDI)
3Wide Area Network (WAN)
4LocalTalk
5Ethernet using DIX header format
6ARCNET
7ARCNET (878.2)
8ATM
9Wireless
10Infrared Wireless
11Bpc
12CoWan
131394
Code
# Value of AdapterTypeID for each instance
# Lookup table for AdapterTypeID (values documented by Microsoft)
$adapterTypeIDName = @{
    0 = 'Ethernet 802.3'
    1 = 'Token Ring 802.5'
    2 = 'Fiber Distributed Data Interface (FDDI)'
    3 = 'Wide Area Network (WAN)'
    4 = 'LocalTalk'
    5 = 'Ethernet using DIX header format'
    6 = 'ARCNET'
    7 = 'ARCNET (878.2)'
    8 = 'ATM'
    9 = 'Wireless'
    10 = 'Infrared Wireless'
    11 = 'Bpc'
    12 = 'CoWan'
    13 = '1394'
}
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, AdapterTypeID |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'AdapterTypeID'; Expression = { $adapterTypeIDName[[int]$_.AdapterTypeID] } }
    )
AutoSensebooleanread

If True, the network adapter can automatically determine the speed of the attached or network media.

This property has not been implemented yet. It returns a NULL value by default.

Code
# Value of AutoSense for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, AutoSense |
    Select-Object -Property DeviceID, AutoSense
Availabilityuint16read

Availability and status of the device.

Values (21)
ValueLabelDescription
1Other
2Unknown
3Running/Full PowerRunning or Full Power
4Warning
5In Test
6Not Applicable
7Power Off
8Off Line
9Off Duty
10Degraded
11Not Installed
12Install Error
13Power Save - UnknownThe device is known to be in a power save state, but its exact status is unknown.
14Power Save - Low Power ModeThe device is in a power save state, but still functioning, and may exhibit degraded performance.
15Power Save - StandbyThe device is not functioning, but could be brought to full power quickly.
16Power Cycle
17Power Save - WarningThe device is in a warning state, though also in a power save state.
18PausedThe device is paused.
19Not ReadyThe device is not ready.
20Not ConfiguredThe device is not configured.
21QuiescedThe device is quiet.
Code
# Value of Availability for each instance
# Lookup table for Availability (values documented by Microsoft)
$availabilityName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Running/Full Power'
    4 = 'Warning'
    5 = 'In Test'
    6 = 'Not Applicable'
    7 = 'Power Off'
    8 = 'Off Line'
    9 = 'Off Duty'
    10 = 'Degraded'
    11 = 'Not Installed'
    12 = 'Install Error'
    13 = 'Power Save - Unknown'
    14 = 'Power Save - Low Power Mode'
    15 = 'Power Save - Standby'
    16 = 'Power Cycle'
    17 = 'Power Save - Warning'
    18 = 'Paused'
    19 = 'Not Ready'
    20 = 'Not Configured'
    21 = 'Quiesced'
}
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, Availability |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'Availability'; Expression = { $availabilityName[[int]$_.Availability] } }
    )
Captionstringread

Short description of the object—a one-line string.

Code
# Value of Caption for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, Caption |
    Select-Object -Property DeviceID, Caption
ConfigManagerErrorCodeuint32read

Windows Configuration Manager error code.

Values (32)
ValueLabelDescription
0This device is working properly.Device is working properly.
1This device is not configured correctly.Device is not configured correctly.
2Windows cannot load the driver for this device.
3The driver for this device might be corrupted, or your system may be running low on memory or other resources.Driver for this device might be corrupted, or the system may be low on memory or other resources.
4This device is not working properly. One of its drivers or your registry might be corrupted.Device is not working properly. One of its drivers or the registry might be corrupted.
5The driver for this device needs a resource that Windows cannot manage.Driver for the device requires a resource that Windows cannot manage.
6The boot configuration for this device conflicts with other devices.Boot configuration for the device conflicts with other devices.
7Cannot filter.
8The driver loader for the device is missing.Driver loader for the device is missing.
9This device is not working properly because the controlling firmware is reporting the resources for the device incorrectly.Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device.
10This device cannot start.Device cannot start.
11This device failed.Device failed.
12This device cannot find enough free resources that it can use.Device cannot find enough free resources to use.
13Windows cannot verify this device's resources.Windows cannot verify the device's resources.
14This device cannot work properly until you restart your computer.Device cannot work properly until the computer is restarted.
15This device is not working properly because there is probably a re-enumeration problem.Device is not working properly due to a possible re-enumeration problem.
16Windows cannot identify all the resources this device uses.Windows cannot identify all of the resources that the device uses.
17This device is asking for an unknown resource type.Device is requesting an unknown resource type.
18Reinstall the drivers for this device.Device drivers must be reinstalled.
19Failure using the VxD loader.
20Your registry might be corrupted.Registry might be corrupted.
21System failure: Try changing the driver for this device. If that does not work, see your hardware documentation. Windows is removing this device.System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device.
22This device is disabled.Device is disabled.
23System failure: Try changing the driver for this device. If that doesn't work, see your hardware documentation.System failure. If changing the device driver is ineffective, see the hardware documentation.
24This device is not present, is not working properly, or does not have all its drivers installed.Device is not present, not working properly, or does not have all of its drivers installed.
25Windows is still setting up this device.Windows is still setting up the device.
26Windows is still setting up this device.Windows is still setting up the device.
27This device does not have valid log configuration.Device does not have valid log configuration.
28The drivers for this device are not installed.Device drivers are not installed.
29This device is disabled because the firmware of the device did not give it the required resources.Device is disabled. The device firmware did not provide the required resources.
30This device is using an Interrupt Request (IRQ) resource that another device is using.Device is using an IRQ resource that another device is using.
31This device is not working properly because Windows cannot load the drivers required for this device.Device is not working properly. Windows cannot load the required device drivers.
Code
# Value of ConfigManagerErrorCode for each instance
# Lookup table for ConfigManagerErrorCode (values documented by Microsoft)
$configManagerErrorCodeName = @{
    0 = 'This device is working properly'
    1 = 'This device is not configured correctly'
    2 = 'Windows cannot load the driver for this device'
    3 = 'The driver for this device might be corrupted, or your…'
    4 = 'This device is not working properly'
    5 = 'The driver for this device needs a resource that Windows…'
    6 = 'The boot configuration for this device conflicts with other…'
    7 = 'Cannot filter'
    8 = 'The driver loader for the device is missing'
    9 = 'This device is not working properly because the controlling…'
    10 = 'This device cannot start'
    11 = 'This device failed'
    12 = 'This device cannot find enough free resources that it can use'
    13 = 'Windows cannot verify this device''s resources'
    14 = 'This device cannot work properly until you restart your…'
    15 = 'This device is not working properly because there is…'
    16 = 'Windows cannot identify all the resources this device uses'
    17 = 'This device is asking for an unknown resource type'
    18 = 'Reinstall the drivers for this device'
    19 = 'Failure using the VxD loader'
    20 = 'Your registry might be corrupted'
    21 = 'System failure: Try changing the driver for this device'
    22 = 'This device is disabled'
    23 = 'System failure: Try changing the driver for this device'
    24 = 'This device is not present, is not working properly, or does…'
    25 = 'Windows is still setting up this device'
    26 = 'Windows is still setting up this device'
    27 = 'This device does not have valid log configuration'
    28 = 'The drivers for this device are not installed'
    29 = 'This device is disabled because the firmware of the device…'
    30 = 'This device is using an Interrupt Request (IRQ) resource…'
    31 = 'This device is not working properly because Windows cannot…'
}
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, ConfigManagerErrorCode |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'ConfigManagerErrorCode'; Expression = { $configManagerErrorCodeName[[int]$_.ConfigManagerErrorCode] } }
    )
ConfigManagerUserConfigbooleanread

If True, the device is using a user-defined configuration.

Code
# Value of ConfigManagerUserConfig for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, ConfigManagerUserConfig |
    Select-Object -Property DeviceID, ConfigManagerUserConfig
CreationClassName keystringread

Name of the first concrete class to appear in the inheritance chain used in the creation of an instance. When used with the other key properties of the class, the property allows all instances of this class and its subclasses to be uniquely identified.

Code
# Value of CreationClassName for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, CreationClassName |
    Select-Object -Property DeviceID, CreationClassName
Descriptionstringread

Description of the object.

Code
# Value of Description for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, Description |
    Select-Object -Property DeviceID, Description
DeviceID keystringread

Unique identifier of the network adapter from other devices on the system.

Code
# Value of DeviceID for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID |
    Select-Object -Property DeviceID
ErrorClearedbooleanread

If True, the error reported in LastErrorCode is now cleared.

Code
# Value of ErrorCleared for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, ErrorCleared |
    Select-Object -Property DeviceID, ErrorCleared
ErrorDescriptionstringread

More information about the error recorded in LastErrorCode, and information about any corrective actions that may be taken.

Code
# Value of ErrorDescription for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, ErrorDescription |
    Select-Object -Property DeviceID, ErrorDescription
GUIDstringread

Globally unique identifier for the connection.

Code
# Value of GUID for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, GUID |
    Select-Object -Property DeviceID, GUID
Indexuint32read

Index number of the network adapter, stored in the system registry.

Example: 0

Code
# Value of Index for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, Index |
    Select-Object -Property DeviceID, Index
InstallDatedatetimeread

Date and time the object was installed. This property does not need a value to indicate that the object is installed.

This property has not been implemented yet. It returns a NULL value by default.

Code
# Value of InstallDate for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, InstallDate |
    Select-Object -Property DeviceID, InstallDate
Installedbooleanread

If True, the network adapter is installed in the system.

Code
# Value of Installed for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, Installed |
    Select-Object -Property DeviceID, Installed
InterfaceIndexuint32read

Index value that uniquely identifies the local network interface. The value in this property is the same as the value in the InterfaceIndex property in the instance of Win32_IP4RouteTable that represents the network interface in the route table.

Code
# Value of InterfaceIndex for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, InterfaceIndex |
    Select-Object -Property DeviceID, InterfaceIndex
LastErrorCodeuint32read

Last error code reported by the logical device.

Code
# Value of LastErrorCode for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, LastErrorCode |
    Select-Object -Property DeviceID, LastErrorCode
MACAddressstringread

Media access control address for this network adapter. A MAC address is a unique 48-bit number assigned to the network adapter by the manufacturer. It uniquely identifies this network adapter and is used for mapping TCP/IP network communications.

Code
# Value of MACAddress for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, MACAddress |
    Select-Object -Property DeviceID, MACAddress
Manufacturerstringread

Name of the network adapter's manufacturer.

Example: "3COM"

Code
# Value of Manufacturer for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, Manufacturer |
    Select-Object -Property DeviceID, Manufacturer
MaxNumberControlleduint32read

Maximum number of directly addressable ports supported by this network adapter. A value of 0 (zero) should be used if the number is unknown.

Code
# Value of MaxNumberControlled for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, MaxNumberControlled |
    Select-Object -Property DeviceID, MaxNumberControlled
MaxSpeeduint64read

Maximum speed, in bits per second, for the network adapter.

This property has not been implemented yet. It returns a NULL value by default.

For more information about using uint64 values in scripts, see Scripting in WMI).

Unit: bits per second

Code
# Value of MaxSpeed for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, MaxSpeed |
    Select-Object -Property DeviceID, MaxSpeed
Namestringread

Label by which the object is known. When subclassed, the property can be overridden to be a key property.

Code
# Value of Name for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, Name |
    Select-Object -Property DeviceID, Name
NetConnectionIDstringread/write

Name of the network connection as it appears in the Network Connections Control Panel program.

Code
# Value of NetConnectionID for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, NetConnectionID |
    Select-Object -Property DeviceID, NetConnectionID

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes NetConnectionID on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_NetworkAdapter -Filter "DeviceID = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ NetConnectionID = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
NetConnectionStatusuint16read

State of the network adapter connection to the network.

Values (14)
ValueLabelDescription
0Disconnected
1Connecting
2Connected
3Disconnecting
4Hardware Not Present
5Hardware Disabled
6Hardware Malfunction
7Media Disconnected
8Authenticating
9Authentication Succeeded
10Authentication Failed
11Invalid Address
12Credentials Required
13..65535Other
Code
# Value of NetConnectionStatus for each instance
# Lookup table for NetConnectionStatus (values documented by Microsoft)
$netConnectionStatusName = @{
    0 = 'Disconnected'
    1 = 'Connecting'
    2 = 'Connected'
    3 = 'Disconnecting'
    4 = 'Hardware Not Present'
    5 = 'Hardware Disabled'
    6 = 'Hardware Malfunction'
    7 = 'Media Disconnected'
    8 = 'Authenticating'
    9 = 'Authentication Succeeded'
    10 = 'Authentication Failed'
    11 = 'Invalid Address'
    12 = 'Credentials Required'
}
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, NetConnectionStatus |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'NetConnectionStatus'; Expression = { $netConnectionStatusName[[int]$_.NetConnectionStatus] } }
    )
NetEnabledbooleanread

Indicates whether the adapter is enabled or not. If True, the adapter is enabled. You can enable or disable the NIC by using the Enable and Disable methods.

Code
# Value of NetEnabled for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, NetEnabled |
    Select-Object -Property DeviceID, NetEnabled
NetworkAddressesstring[]read

Array of network addresses for an adapter.

This property has not been implemented yet. It returns a NULL value by default.

Code
# Value of NetworkAddresses for each instance
# NetworkAddresses is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_NetworkAdapter -Property NetworkAddresses |
    Select-Object -ExpandProperty NetworkAddresses
PermanentAddressstringread

Network address hard-coded into an adapter. This hard-coded address may be changed by firmware upgrade or software configuration. If so, this field should be updated when the change is made. The property should be left blank if no hard-coded address exists for the network adapter.

This property has not been implemented yet. It returns a NULL value by default.

Code
# Value of PermanentAddress for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, PermanentAddress |
    Select-Object -Property DeviceID, PermanentAddress
PhysicalAdapterbooleanread

Indicates whether the adapter is a physical or a logical adapter. If True, the adapter is physical.

Code
# Value of PhysicalAdapter for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, PhysicalAdapter |
    Select-Object -Property DeviceID, PhysicalAdapter
PNPDeviceIDstringread

Windows Plug and Play device identifier of the logical device.

Example: "*PNP030b"

Code
# Value of PNPDeviceID for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, PNPDeviceID |
    Select-Object -Property DeviceID, PNPDeviceID
PowerManagementCapabilitiesuint16[]read

Array of the specific power-related capabilities of a logical device.

Values (8)
ValueLabelDescription
0Unknown
1Not Supported
2Disabled
3EnabledThe power management features are currently enabled but the exact feature set is unknown or the information is unavailable.
4Power Saving Modes Entered AutomaticallyThe device can change its power state based on usage or other criteria.
5Power State SettableThe SetPowerState method is supported. This method is found on the parent CIM_LogicalDevice class and can be implemented. For more information, see Designing Managed Object Format (MOF) Classes.
6Power Cycling SupportedThe SetPowerState method can be invoked with the *PowerState* parameter set to 5 (Power Cycle).
7Timed Power On SupportedTimed Power-On Supported The SetPowerState method can be invoked with the *PowerState* parameter set to 5 (Power Cycle) and *Time* set to a specific date and time, or interval, for power-on.
Code
# Value of PowerManagementCapabilities for each instance
# Lookup table for PowerManagementCapabilities (values documented by Microsoft)
$powerManagementCapabilitiesName = @{
    0 = 'Unknown'
    1 = 'Not Supported'
    2 = 'Disabled'
    3 = 'Enabled'
    4 = 'Power Saving Modes Entered Automatically'
    5 = 'Power State Settable'
    6 = 'Power Cycling Supported'
    7 = 'Timed Power On Supported'
}
# PowerManagementCapabilities is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_NetworkAdapter -Property PowerManagementCapabilities |
    Select-Object -ExpandProperty PowerManagementCapabilities |
    ForEach-Object -Process { $powerManagementCapabilitiesName[[int]$_] }
PowerManagementSupportedbooleanread

If True, the device can be power-managed (can be put into suspend mode, and so on). The property does not indicate that power management features are currently enabled, only that the logical device is capable of power management.

Code
# Value of PowerManagementSupported for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, PowerManagementSupported |
    Select-Object -Property DeviceID, PowerManagementSupported
ProductNamestringread

Product name of the network adapter.

Example: "Fast EtherLink XL"

Code
# Value of ProductName for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, ProductName |
    Select-Object -Property DeviceID, ProductName
ServiceNamestringread

Service name of the network adapter. This name is usually shorter than the full product name.

Example: "Elnkii"

Code
# Value of ServiceName for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, ServiceName |
    Select-Object -Property DeviceID, ServiceName
Speeduint64read

Estimate of the current bandwidth in bits per second. For endpoints which vary in bandwidth or for those where no accurate estimation can be made, this property should contain the nominal bandwidth.

For more information about using uint64 values in scripts, see Scripting in WMI).

Unit: bits per second

Code
# Value of Speed for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, Speed |
    Select-Object -Property DeviceID, Speed
Statusstringread

Current status of the object. This property is inherited from CIM_ManagedSystemElement.

Values include the following:

Values (12)
ValueLabelDescription
OKOK
ErrorError
DegradedDegraded
UnknownUnknown
Pred FailPred Fail
StartingStarting
StoppingStopping
ServiceService
StressedStressed
NonRecoverNonRecover
No ContactNo Contact
Lost CommLost Comm
Code
# Value of Status for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, Status |
    Select-Object -Property DeviceID, Status
StatusInfouint16read

State of the logical device. If this property does not apply to the logical device, the value 5 (Not Applicable) should be used.

Values (5)
ValueLabelDescription
1Other
2Unknown
3Enabled
4Disabled
5Not Applicable
Code
# Value of StatusInfo for each instance
# Lookup table for StatusInfo (values documented by Microsoft)
$statusInfoName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Enabled'
    4 = 'Disabled'
    5 = 'Not Applicable'
}
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, StatusInfo |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'StatusInfo'; Expression = { $statusInfoName[[int]$_.StatusInfo] } }
    )
SystemCreationClassName keystringread

Value of the scoping computer's CreationClassName property.

Code
# Value of SystemCreationClassName for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, SystemCreationClassName |
    Select-Object -Property DeviceID, SystemCreationClassName
SystemName keystringread

Name of the scoping system.

Code
# Value of SystemName for each instance
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, SystemName |
    Select-Object -Property DeviceID, SystemName
TimeOfLastResetdatetimeread

Date and time the network adapter was last reset.

Code
# Value of TimeOfLastReset for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName Win32_NetworkAdapter -Property DeviceID, TimeOfLastReset |
    Select-Object -Property DeviceID, TimeOfLastReset

Methods

Disable #

Disables the network adapter.

uint32 Disable();

Call the Disable method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_NetworkAdapter -Filter "DeviceID = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'Disable'
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $result.ReturnValue
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

Enable #

Enables the network adapter.

uint32 Enable();

Call the Enable method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_NetworkAdapter -Filter "DeviceID = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'Enable'
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $result.ReturnValue
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

Declared but not implemented methods: Reset, SetPowerState.

Remarks

The Win32_NetworkAdapter class is derived from CIM_NetworkAdapter.

The following list describes the Associator classes for Win32_NetworkAdapter:

  • Win32_PnPEntity
  • Win32_ComputerSystem
  • Win32_NetworkAdapterConfiguration
  • Win32_IRQResource
  • Win32_DeviceMemoryAddress
  • Win32_PortResource
  • Win32_NetworkProtocol
  • Win32_SystemDriver

Many systems have a number of network adapters on them. Consider using the following as a reference to find the current adapters:

``` syntax

AdapterType: "Ethernet 802.3"

MACAddress: String Length > 16

Availability: 3

PNPDeviceID: InStr ( PNPDeviceID, "PCI") = 1

Installed: vbTrue

ConfigManagerErrorCode: 0

: <keep this as an index to Win32_NetworkAdapterConfiguration>

```

Even using the above qualifiers, you will likely retrieve more than one valid network adapter. If that is the case, Then you can use the following information to further qualify your search of the Win32_NetworkAdapterConfiguration:

``` syntax

Index: <match to DeviceID above>

MACAddress: Length > 16

DefaultIPGateway: String Length > 6

DNSServerSearchOrder: Array of strings with length > 6

IPEnabled: vbTrue

IPAddress: Array of strings with length > 6

```

Once you have done so, you will likely have reduced your list to one or two configured adapters.

You can also use the following procedure to find the default adapter:

1. Run the following query:

"SELECT InterfaceIndex, Destination FROM Win32_IP4RouteTable WHERE Destination='0.0.0.0'"

You should only have one default network destination 0.0.0.0.

2. Use the InterfaceIndex to retrieve the Network Adapter you want.

"SELECT * FROM Win32_NetworkAdapter WHERE InterfaceIndex=" + insertVariableHere

Inheritance

Superclass chain

  1. CIM_ManagedSystemElement
  2. CIM_LogicalElement
  3. CIM_LogicalDevice
  4. CIM_NetworkAdapter
  5. Win32_NetworkAdapter

Known subclasses

No known subclass.

Requirements

Namespace
root/cimv2
Minimum client
Windows Vista
Minimum server
Windows Server 2008
Provider
CIMWin32
MOF file
CIMWin32.mof
DLL
CIMWin32.dll
Class qualifiers

Dynamic Provider("CIMWin32") UUID("{8502C4C0-5FBB-11D2-AAC1-006008C78BC7}") AMENDMENT

Microsoft source

Source: Microsoft Learn

Descriptions, properties and methods come from the Microsoft documentation (MicrosoftDocs/win32 repository), published under the CC BY 4.0 licence. Formatting and translations are specific to this site; the PowerShell examples are written for it.