The Win32_NetworkAdapterConfiguration WMI classrepresents the attributes and behaviors of a network adapter. This class includes extra properties and methods that support the management of the TCP/IP protocol that are independent from the network adapter.
Methods
Win32_NetworkAdapterConfiguration has 41 methods:
Method | Description |
---|---|
DisableIPSec | Disables IPsec on this TCP/IP-enabled network adapter. |
EnableDHCP | Enables the Dynamic Host Configuration Protocol (DHCP) for service with this network adapter. |
EnableDNS | Enables the Domain Name System (DNS) for service on this TCP/IP-bound network adapter. |
EnableIPFilterSec | Enables IPsec globally across all IP-bound network adapters. |
EnableIPSec | Enables IPsec on this specific TCP/IP-enabled network adapter. |
EnableStatic | Enables static TCP/IP addressing for the target network adapter. |
EnableWINS | Enables WINS settings specific to TCP/IP, but independent of the network adapter. |
ReleaseDHCPLease | Releases the IP address bound to a specific DHCP-enabled network adapter. |
ReleaseDHCPLeaseAll | Releases the IP addresses bound to all DHCP-enabled network adapters. |
RenewDHCPLease | Renews the IP address on specific DHCP-enabled network adapters. |
RenewDHCPLeaseAll | Renews the IP addresses on all DHCP-enabled network adapters. |
SetArpAlwaysSourceRoute | Sets the transmission of ARP queries by the TCP/IP. |
SetArpUseEtherSNAP | Enables Ethernet packets to use 802.3 SNAP encoding. |
SetDatabasePath | Sets the path to the standard Internet database files (HOSTS, LMHOSTS, NETWORKS, and PROTOCOLS). |
SetDeadGWDetect | Enables dead gateway detection. |
SetDefaultTOS | Obsolete. This method sets the default Type of Service (TOS) value in the header of outgoing IP packets. |
SetDefaultTTL | Sets the default Time to Live (TTL) value in the header of outgoing IP packets. |
SetDNSDomain | Sets the DNS domain. |
SetDNSServerSearchOrder | Sets the server search order as an array of elements. |
SetDNSSuffixSearchOrder | Sets the suffix search order as an array of elements. |
SetDynamicDNSRegistration | Indicates dynamic DNS registration of IP addresses for this IP-bound adapter. |
SetForwardBufferMemory | Specifies how much memory IP allocates to store packet data in the router packet queue. |
SetGateways | Specifies a list of gateways for routing packets destined for a different subnet than the one this adapter is connected to. |
SetIGMPLevel | Sets the extent to which the system supports IP multicasting and participates in the Internet Group Management Protocol. |
SetIPConnectionMetric | Sets the routing metric associated with this IP-bound adapter. |
SetIPUseZeroBroadcast | Sets IP zero broadcast usage. |
SetIPXFrameTypeNetworkPairs | Sets Internetworking Packet Exchange (IPX) network number/frame pairs for this network adapter. |
SetIPXVirtualNetworkNumber | Sets the Internetworking Packet Exchange (IPX) virtual network number on the target computer system. |
SetKeepAliveInterval | Sets the interval separating Keep Alive Retransmissions until a response is received. |
SetKeepAliveTime | Sets how often TCP attempts to verify that an idle connection is still available by sending a Keep Alive packet. |
SetMTU | Sets the default Maximum Transmission Unit (MTU) for a network interface. This method is not supported. |
SetNumForwardPackets | Sets the number of IP packet headers allocated for the router packet queue. |
SetPMTUBHDetect | Enables detection of Black Hole routers. |
SetPMTUDiscovery | Enables Maximum Transmission Unit (MTU) discovery. |
SetTcpipNetbios | Sets the default operation of NetBIOS over TCP/IP. |
SetTcpMaxConnectRetransmissions | Sets the number of attempts TCP will retransmit a connect request before aborting. |
SetTcpMaxDataRetransmissions | Sets the number of times TCP will retransmit an individual data segment before aborting the connection. |
SetTcpNumConnections | Sets the maximum number of connections that TCP may have open simultaneously. |
SetTcpUseRFC1122UrgentPointer | Specifies whether TCP uses the RFC 1122 specification for urgent data, or the mode used by Berkeley Software Design (BSD) derived systems. |
SetTcpWindowSize | Sets the maximum TCP Receive Window size offered by the system. |
SetWINSServer | Sets the primary and secondary Windows Internet Naming Service (WINS) servers on this TCP/IP-bound network adapter. |
Learn more about Invoke-CimMethod
and how to invoke commands. Click any of the methods listed above to learn more about their purpose, parameters, and return value.
Properties
Win32_NetworkAdapterConfiguration returns 61 properties:
'ArpAlwaysSourceRoute','ArpUseEtherSNAP','Caption','DatabasePath',
'DeadGWDetectEnabled','DefaultIPGateway','DefaultTOS','DefaultTTL','Description','DHCPEnabled',
'DHCPLeaseExpires','DHCPLeaseObtained','DHCPServer','DNSDomain','DNSDomainSuffixSearchOrder',
'DNSEnabledForWINSResolution','DNSHostName','DNSServerSearchOrder','DomainDNSRegistrationEnabled',
'ForwardBufferMemory','FullDNSRegistrationEnabled','GatewayCostMetric','IGMPLevel','Index',
'InterfaceIndex','IPAddress','IPConnectionMetric','IPEnabled','IPFilterSecurityEnabled',
'IPPortSecurityEnabled','IPSecPermitIPProtocols','IPSecPermitTCPPorts','IPSecPermitUDPPorts','IPSubnet',
'IPUseZeroBroadcast','IPXAddress','IPXEnabled','IPXFrameType','IPXMediaType','IPXNetworkNumber',
'IPXVirtualNetNumber','KeepAliveInterval','KeepAliveTime','MACAddress','MTU','NumForwardPackets',
'PMTUBHDetectEnabled','PMTUDiscoveryEnabled','ServiceName','SettingID','TcpipNetbiosOptions',
'TcpMaxConnectRetransmissions','TcpMaxDataRetransmissions','TcpNumConnections','TcpUseRFC1122UrgentPointer',
'TcpWindowSize','WINSEnableLMHostsLookup','WINSHostLookupFile','WINSPrimaryServer','WINSScopeID',
'WINSSecondaryServer'
Unless explicitly marked as writeable, all properties are read-only. Read all properties for all instances:
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -Property *
Most WMI classes return one or more instances.
When
Get-CimInstance
returns no result, then apparently no instances of class Win32_NetworkAdapterConfiguration exist. This is normal behavior.Either the class is not implemented on your system (may be deprecated or due to missing drivers, i.e. CIM_VideoControllerResolution), or there are simply no physical representations of this class currently available (i.e. Win32_TapeDrive).
ArpAlwaysSourceRoute
If TRUE, TCP/IP transmits Address Resolution Protocol (ARP) queries with source routing enabled on Token Ring networks. By default (FALSE), ARP first queries without source routing, and then retries with source routing enabled if no reply is received. Source routing allows the routing of network packets across different types of networks.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, ArpAlwaysSourceRoute
ArpUseEtherSNAP
If TRUE, Ethernet packets follow the IEEE 802.3 Sub-Network Access Protocol (SNAP) encoding. Setting this parameter to 1 forces TCP/IP to transmit Ethernet packets by using 802.3 SNAP encoding. By default (FALSE), the stack transmits packets in DIX Ethernet format.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, ArpUseEtherSNAP
Caption
Short textual description of the current object.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, Caption
DatabasePath
Valid Windows file path to standard Internet database files (HOSTS, LMHOSTS, NETWORKS, and PROTOCOLS). The file path is used by the Windows Sockets interface.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DatabasePath
DeadGWDetectEnabled
If TRUE, dead gateway detection occurs. With this feature enabled, Transmission Control Protocol (TCP) asks Internet Protocol (IP) to change to a backup gateway if it retransmits a segment several times without receiving a response.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DeadGWDetectEnabled
DefaultIPGateway
Array of IP addresses of default gateways that the computer system uses.
Example: “192.168.12.1 192.168.46.1”
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DefaultIPGateway
DefaultTOS
Default Type Of Service (TOS) value set in the header of outgoing IP packets. Request for Comments (RFC) 791 defines the values. Default: 0 (zero), Valid Range: 0 - 255.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DefaultTOS
DefaultTTL
Default Time To Live (TTL) value set in the header of outgoing IP packets. The TTL specifies the number of routers an IP packet can pass through to reach its destination before being discarded. Each router decrements by one the TTL count of a packet as it passes through and discards the packetsâif the TTL is 0 (zero). Default: 32, Valid Range: 1 - 255.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DefaultTTL
Description
Textual description of the current object.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, Description
DHCPEnabled
If TRUE, the dynamic host configuration protocol (DHCP) server automatically assigns an IP address to the computer system when establishing a network connection.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DHCPEnabled
DHCPLeaseExpires
Expiration date and time for a leased IP address that was assigned to the computer by the dynamic host configuration protocol (DHCP) server.
Example: 20521201000230.000000000
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DHCPLeaseExpires
DHCPLeaseObtained
Date and time the lease was obtained for the IP address assigned to the computer by the dynamic host configuration protocol (DHCP) server.
Example: 19521201000230.000000000
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DHCPLeaseObtained
DHCPServer
IP address of the dynamic host configuration protocol (DHCP) server.
Example: “10.55.34.2”
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DHCPServer
DNSDomain
Organization name followed by a period and an extension that indicates the type of organization, such as “microsoft.com”. The name can be any combination of the letters A through Z, the numerals 0 through 9, and the hyphen (-), plus the period (.) character used as a separator.
Example: “microsoft.com”
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DNSDomain
DNSDomainSuffixSearchOrder
Array of DNS domain suffixes to be appended to the end of host names during name resolution. When attempting to resolve a fully qualified domain name (FQDN) from a host-only name, the system will first append the local domain name. If this is not successful, the system will use the domain suffix list to create additional FQDNs in the order listed and query DNS servers for each.
Example: “samples.microsoft.com example.microsoft.com”
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DNSDomainSuffixSearchOrder
DNSEnabledForWINSResolution
If TRUE, the Domain Name System (DNS) is enabled for name resolution over Windows Internet Naming Service (WINS) resolution. If the name cannot be resolved using DNS, the name request is forwarded to WINS for resolution.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DNSEnabledForWINSResolution
DNSHostName
Host name used to identify the local computer for authentication by some utilities. Other TCP/IP-based utilities can use this value to acquire the name of the local computer. Host names are stored on DNS servers in a table that maps names to IP addresses for use by DNS. The name can be any combination of the letters A through Z, the numerals 0 through 9, and the hyphen (-), plus the period (.) character used as a separator. By default, this value is the Microsoft networking computer name, but the network administrator can assign another host name without affecting the computer name.
Example: “corpdns”
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DNSHostName
DNSServerSearchOrder
Array of server IP addresses to be used in querying for DNS servers.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DNSServerSearchOrder
DomainDNSRegistrationEnabled
If TRUE, the IP addresses for this connection are registered in DNS under the domain name of this connection in addition to being registered under the computer’s full DNS name. The domain name of this connection is either set using the SetDNSDomain() method or assigned by DSCP. The registered name is the host name of the computer with the domain name appended.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, DomainDNSRegistrationEnabled
ForwardBufferMemory
Memory allocated by IP to store packet data in the router packet queue. When this buffer space is filled, the router begins discarding packets at random from its queue. Packet queue data buffers are 256 bytes in length, so the value of this parameter should be a multiple of 256. Multiple buffers are chained together for larger packets. The IP header for a packet is stored separately. This parameter is ignored and no buffers are allocated if the IP router is not enabled. The buffer size can range from the network MTU to a value smaller than 0xFFFFFFFF. Default: 74240 (fifty 1480-byte packets, rounded to a multiple of 256).
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, ForwardBufferMemory
FullDNSRegistrationEnabled
If TRUE, the IP addresses for this connection are registered in DNS under the computer’s full DNS name. The full DNS name of the computer is displayed on the Network Identification tab in the System application in Control Panel.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, FullDNSRegistrationEnabled
GatewayCostMetric
Array of integer cost metric values (ranging from 1 to 9999) to be used in calculating the fastest, most reliable, or least resource-intensive routes. This argument has a one-to-one correspondence with the DefaultIPGateway property.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, GatewayCostMetric
IGMPLevel
Extent to which the system supports IP multicast and participates in the Internet Group Management Protocol (IGMP). At level 0 (zero), the system provides no multicast support. At level 1, the system may only send IP multicast packets. At level 2, the system may send IP multicast packets and fully participate in IGMP to receive multicast packets.
IGMPLevel returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$IGMPLevel_map = @{
0 = 'No Multicast'
1 = 'IP Multicast'
2 = 'IP & IGMP multicast'
}
Use a switch statement
switch([int]$value)
{
0 {'No Multicast'}
1 {'IP Multicast'}
2 {'IP & IGMP multicast'}
default {"$value"}
}
Use Enum structure
Enum EnumIGMPLevel
{
No_Multicast = 0
IP_Multicast = 1
IP_IGMP_multicast = 2
}
Examples
Use $IGMPLevel_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "IGMPLevel" to friendly text
Note: to use other properties than "IGMPLevel", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "IGMPLevel"
# to translate other properties, use their translation table instead
$IGMPLevel_map = @{
0 = 'No Multicast'
1 = 'IP Multicast'
2 = 'IP & IGMP multicast'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "IGMPLevel", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$IGMPLevel = @{
Name = 'IGMPLevel'
Expression = {
# property is an array, so process all values
$value = $_.IGMPLevel
$IGMPLevel_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "IGMPLevel". The latter
# is defined by the hashtable in $IGMPLevel:
Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -Property Caption, $IGMPLevel
# ...or dump content of property IGMPLevel:
$friendlyValues = Get-CimInstance -Class Win32_NetworkAdapterConfiguration |
Select-Object -Property $IGMPLevel |
Select-Object -ExpandProperty IGMPLevel
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $IGMPLevel_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_NetworkAdapterConfiguration" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_NetworkAdapterConfiguration", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_NetworkAdapterConfiguration"
# to translate other properties, use their translation table instead
$IGMPLevel_map = @{
0 = 'No Multicast'
1 = 'IP Multicast'
2 = 'IP & IGMP multicast'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.IGMPLevel
# translate raw value to friendly text:
$friendlyName = $IGMPLevel_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "IGMPLevel" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "IGMPLevel", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "IGMPLevel", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$IGMPLevel = @{
Name = 'IGMPLevel'
Expression = {
# property is an array, so process all values
$value = $_.IGMPLevel
switch([int]$value)
{
0 {'No Multicast'}
1 {'IP Multicast'}
2 {'IP & IGMP multicast'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration |
# ...and output properties "Caption" and "IGMPLevel". The latter is defined
# by the hashtable in $IGMPLevel:
Select-Object -Property Caption, $IGMPLevel
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_NetworkAdapterConfiguration", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumIGMPLevel
{
No_Multicast = 0
IP_Multicast = 1
IP_IGMP_multicast = 2
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.IGMPLevel
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **IGMPLevel**
[EnumIGMPLevel]$rawValue
# get a comma-separated string:
[EnumIGMPLevel]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumIGMPLevel]
#endregion
Enums must cover all possible values. If IGMPLevel returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
Index
Index number of the Windows network adapter configuration. The index number is used when there is more than one configuration available.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index
InterfaceIndex
Index value that uniquely identifies a 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.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, InterfaceIndex
IPAddress
Array of all of the IP addresses associated with the current network adapter. This property can contain either IPv6 addresses or IPv4 addresses. For more information, see IPv6 and IPv4 Support in WMI.
Example IPv6 address: “2010:836B:4179::836B:4179”
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPAddress
IPConnectionMetric
Cost of using the configured routes for the IP bound adapter and is the weighted value for those routes in the IP routing table. If there are multiple routes to a destination in the IP routing table, the route with the lowest metric is used. The default value is 1.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPConnectionMetric
IPEnabled
If TRUE, TCP/IP is bound and enabled on this network adapter.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPEnabled
IPFilterSecurityEnabled
If TRUE, IP port security is enabled globally across all IP-bound network adapters and the security values associated with individual network adapters are in effect. This property is used in conjunction with IPSecPermitTCPPorts, IPSecPermitUDPPorts, and IPSecPermitIPProtocols. If FALSE, IP filter security is disabled across all network adapters and allows all port and protocol traffic to flow unfiltered.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPFilterSecurityEnabled
IPPortSecurityEnabled
If TRUE, IP port security is enabled globally across all IP-bound network adapters. This property is obsolete. In place of this property, you should use IPFilterSecurityEnabled.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPPortSecurityEnabled
IPSecPermitIPProtocols
Array of the protocols permitted to run over the IP. The list of protocols is defined using the EnableIPSec method. The list will either be empty or contain numeric values. A numeric value of 0 (zero) indicates access permission is granted for all protocols. An empty string indicates that no protocols are permitted to run when IPFilterSecurityEnabled is TRUE.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPSecPermitIPProtocols
IPSecPermitTCPPorts
Array of the ports that will be granted access permission for TCP. The list of protocols is defined using the EnableIPSec method. The list will either be empty or contain numeric values. A numeric value of 0 (zero)indicates access permission is granted for all ports. An empty string indicates that no ports are granted access permission when IPFilterSecurityEnabled is TRUE.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPSecPermitTCPPorts
IPSecPermitUDPPorts
Array of the ports that will be granted User Datagram Protocol (UDP) access permission. The list of protocols is defined using the EnableIPSec method. The list will either be empty or contain numeric values. A numeric value of 0 (zero) indicates access permission is granted for all ports. An empty string indicates that no ports are granted access permission when IPFilterSecurityEnabled is TRUE.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPSecPermitUDPPorts
IPSubnet
Array of all of the subnet masks associated with the current network adapter.
Example: “255.255.0.0”
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPSubnet
IPUseZeroBroadcast
If TRUE, IP zeros-broadcasts are used (0.0.0.0), and the system uses ones-broadcasts (255.255.255.255). Computer systems generally use ones-broadcasts, but those derived from BSD implementations use zeros-broadcasts. Systems that do not use that same broadcasts will not interoperate on the same network. The default is FALSE.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPUseZeroBroadcast
IPXAddress
The Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPXAddress
IPXEnabled
The Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPXEnabled
IPXFrameType
The Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.
IPXFrameType returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$IPXFrameType_map = @{
0 = 'Ethernet II'
1 = 'Ethernet 802.3'
2 = 'Ethernet 802.2'
3 = 'Ethernet SNAP'
255 = 'AUTO'
}
Use a switch statement
switch([int]$value)
{
0 {'Ethernet II'}
1 {'Ethernet 802.3'}
2 {'Ethernet 802.2'}
3 {'Ethernet SNAP'}
255 {'AUTO'}
default {"$value"}
}
Use Enum structure
Enum EnumIPXFrameType
{
Ethernet_II = 0
Ethernet_8023 = 1
Ethernet_8022 = 2
Ethernet_SNAP = 3
AUTO = 255
}
Examples
Use $IPXFrameType_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "IPXFrameType" to friendly text
Note: to use other properties than "IPXFrameType", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "IPXFrameType"
# to translate other properties, use their translation table instead
$IPXFrameType_map = @{
0 = 'Ethernet II'
1 = 'Ethernet 802.3'
2 = 'Ethernet 802.2'
3 = 'Ethernet SNAP'
255 = 'AUTO'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "IPXFrameType", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$IPXFrameType = @{
Name = 'IPXFrameType'
Expression = {
# property is an array, so process all values
$result = foreach($value in $_.IPXFrameType)
{
# important: convert original value to [int] because
# hashtable keys are type-aware:
$IPXFrameType_map[[int]$value]
}
# uncomment to get a comma-separated string instead
# of a string array:
$result <#-join ', '#>
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "IPXFrameType". The latter
# is defined by the hashtable in $IPXFrameType:
Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -Property Caption, $IPXFrameType
# ...or dump content of property IPXFrameType:
$friendlyValues = Get-CimInstance -Class Win32_NetworkAdapterConfiguration |
Select-Object -Property $IPXFrameType |
Select-Object -ExpandProperty IPXFrameType
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $IPXFrameType_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_NetworkAdapterConfiguration" to friendly text. This approach is ideal when there
is just one instance to work with.
Note: to use other properties than "Win32_NetworkAdapterConfiguration", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_NetworkAdapterConfiguration"
# to translate other properties, use their translation table instead
$IPXFrameType_map = @{
0 = 'Ethernet II'
1 = 'Ethernet 802.3'
2 = 'Ethernet 802.2'
3 = 'Ethernet SNAP'
255 = 'AUTO'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property (hint: the property is an array!)
$rawValues = $instance.IPXFrameType
# translate all raw values into friendly names:
$friendlyNames = foreach($rawValue in $rawValues)
{ $IPXFrameType_map[[int]$rawValue] }
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "IPXFrameType" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "IPXFrameType", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "IPXFrameType", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$IPXFrameType = @{
Name = 'IPXFrameType'
Expression = {
# property is an array, so process all values
$result = foreach($value in $_.IPXFrameType)
{
switch([int]$value)
{
0 {'Ethernet II'}
1 {'Ethernet 802.3'}
2 {'Ethernet 802.2'}
3 {'Ethernet SNAP'}
255 {'AUTO'}
default {"$value"}
}
}
$result
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration |
# ...and output properties "Caption" and "IPXFrameType". The latter is defined
# by the hashtable in $IPXFrameType:
Select-Object -Property Caption, $IPXFrameType
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_NetworkAdapterConfiguration", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumIPXFrameType
{
Ethernet_II = 0
Ethernet_8023 = 1
Ethernet_8022 = 2
Ethernet_SNAP = 3
AUTO = 255
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.IPXFrameType
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **IPXFrameType**
[EnumIPXFrameType[]]$rawValue
# get a comma-separated string:
[EnumIPXFrameType[]]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumIPXFrameType[]]
#endregion
Enums must cover all possible values. If IPXFrameType returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
IPXMediaType
The Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.
IPXMediaType returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$IPXMediaType_map = @{
1 = 'Ethernet'
2 = 'Token ring'
3 = 'FDDI'
8 = 'ARCNET'
}
Use a switch statement
switch([int]$value)
{
1 {'Ethernet'}
2 {'Token ring'}
3 {'FDDI'}
8 {'ARCNET'}
default {"$value"}
}
Use Enum structure
Enum EnumIPXMediaType
{
Ethernet = 1
Token_ring = 2
FDDI = 3
ARCNET = 8
}
Examples
Use $IPXMediaType_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "IPXMediaType" to friendly text
Note: to use other properties than "IPXMediaType", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "IPXMediaType"
# to translate other properties, use their translation table instead
$IPXMediaType_map = @{
1 = 'Ethernet'
2 = 'Token ring'
3 = 'FDDI'
8 = 'ARCNET'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "IPXMediaType", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$IPXMediaType = @{
Name = 'IPXMediaType'
Expression = {
# property is an array, so process all values
$value = $_.IPXMediaType
$IPXMediaType_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "IPXMediaType". The latter
# is defined by the hashtable in $IPXMediaType:
Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -Property Caption, $IPXMediaType
# ...or dump content of property IPXMediaType:
$friendlyValues = Get-CimInstance -Class Win32_NetworkAdapterConfiguration |
Select-Object -Property $IPXMediaType |
Select-Object -ExpandProperty IPXMediaType
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $IPXMediaType_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_NetworkAdapterConfiguration" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_NetworkAdapterConfiguration", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_NetworkAdapterConfiguration"
# to translate other properties, use their translation table instead
$IPXMediaType_map = @{
1 = 'Ethernet'
2 = 'Token ring'
3 = 'FDDI'
8 = 'ARCNET'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.IPXMediaType
# translate raw value to friendly text:
$friendlyName = $IPXMediaType_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "IPXMediaType" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "IPXMediaType", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "IPXMediaType", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$IPXMediaType = @{
Name = 'IPXMediaType'
Expression = {
# property is an array, so process all values
$value = $_.IPXMediaType
switch([int]$value)
{
1 {'Ethernet'}
2 {'Token ring'}
3 {'FDDI'}
8 {'ARCNET'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration |
# ...and output properties "Caption" and "IPXMediaType". The latter is defined
# by the hashtable in $IPXMediaType:
Select-Object -Property Caption, $IPXMediaType
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_NetworkAdapterConfiguration", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumIPXMediaType
{
Ethernet = 1
Token_ring = 2
FDDI = 3
ARCNET = 8
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.IPXMediaType
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **IPXMediaType**
[EnumIPXMediaType]$rawValue
# get a comma-separated string:
[EnumIPXMediaType]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumIPXMediaType]
#endregion
Enums must cover all possible values. If IPXMediaType returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
IPXNetworkNumber
The Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPXNetworkNumber
IPXVirtualNetNumber
The Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, IPXVirtualNetNumber
KeepAliveInterval
Interval separating Keep Alive Retransmissions until a response is received. After a response is received, the delay until the next Keep Alive Transmission is again controlled by the value of KeepAliveTime. The connection will be aborted after the number of retransmissions specified by TcpMaxDataRetransmissions have gone unanswered. Default: 1000, Valid Range: 1 - 0xFFFFFFFF.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, KeepAliveInterval
KeepAliveTime
The KeepAliveTime property indicates how often the TCP attempts to verify that an idle connection is still intact by sending a Keep Alive Packet. A remote system that is reachable will acknowledge the keep alive transmission. Keep Alive packets are not sent by default. This feature may be enabled in a connection by an application. Default: 7,200,000 (two hours).
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, KeepAliveTime
MACAddress
Media Access Control (MAC) address of the network adapter. A MAC address is assigned by the manufacturer to uniquely identify the network adapter.
Example: “00:80:C7:8F:6C:96”
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, MACAddress
MTU
Overrides the default Maximum Transmission Unit (MTU) for a network interface. The MTU is the maximum packet size (including the transport header) that the transport will transmit over the underlying network. The IP datagram can span multiple packets. The range of this value spans the minimum packet size (68) to the MTU supported by the underlying network.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, MTU
NumForwardPackets
Number of IP packet headers allocated for the router packet queue. When all headers are in use, the router will begin to discard packets from the queue at random. This value should be at least as large as the ForwardBufferMemory value divided by the maximum IP data size of the networks connected to the router. It should be no larger than the ForwardBufferMemory value divided by 256, since at least 256 bytes of forward buffer memory are used for each packet. The optimal number of forward packets for a given ForwardBufferMemory size depends on the type of traffic on the network. It will be somewhere between these two values. If the router is not enabled, this parameter is ignored and no headers are allocated. Default: 50, Valid Range: 1 - 0xFFFFFFFE.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, NumForwardPackets
PMTUBHDetectEnabled
If TRUE, detection of black hole routers occurs while TCP discovers the path of the Maximum Transmission Unit. A black hole router does not return ICMP Destination Unreachable messages when it needs to fragment an IP datagram with the Don’t Fragment bit set. TCP depends on receiving these messages to perform Path MTU Discovery. With this feature enabled, TCP will try to send segments without the Don’t Fragment bit set if several retransmissions of a segment go unacknowledged. If the segment is acknowledged as a result, the MSS will be decreased and the Don’t Fragment bit will be set in future packets on the connection. Enabling black hole detection increases the maximum number of retransmissions performed for a given segment. The default value of this property is FALSE.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, PMTUBHDetectEnabled
PMTUDiscoveryEnabled
If TRUE, the Maximum Transmission Unit (MTU) path is discovered over the path to a remote host. By discovering the MTU path and limiting TCP segments to this size, TCP can eliminate fragmentation at routers along the path that connect networks with different MTUs. Fragmentation adversely affects TCP throughput and network congestion. Setting this parameter to FALSE causes an MTU of 576 bytes to be used for all connections that are not to machines on the local subnet. The default is TRUE.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, PMTUDiscoveryEnabled
ServiceName
Service name of the network adapter. This name is usually shorter than the full product name.
Example: “Elnkii”
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, ServiceName
SettingID
Identifier by which the current object is known.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, SettingID
TcpipNetbiosOptions
Bitmap of the possible settings related to NetBIOS over TCP/IP. Values are identified in the following list.
TcpipNetbiosOptions returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$TcpipNetbiosOptions_map = @{
0 = 'EnableNetbiosViaDhcp'
1 = 'EnableNetbios'
2 = 'DisableNetbios'
}
Use a switch statement
switch([int]$value)
{
0 {'EnableNetbiosViaDhcp'}
1 {'EnableNetbios'}
2 {'DisableNetbios'}
default {"$value"}
}
Use Enum structure
Enum EnumTcpipNetbiosOptions
{
EnableNetbiosViaDhcp = 0
EnableNetbios = 1
DisableNetbios = 2
}
Examples
Use $TcpipNetbiosOptions_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "TcpipNetbiosOptions" to friendly text
Note: to use other properties than "TcpipNetbiosOptions", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "TcpipNetbiosOptions"
# to translate other properties, use their translation table instead
$TcpipNetbiosOptions_map = @{
0 = 'EnableNetbiosViaDhcp'
1 = 'EnableNetbios'
2 = 'DisableNetbios'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "TcpipNetbiosOptions", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$TcpipNetbiosOptions = @{
Name = 'TcpipNetbiosOptions'
Expression = {
# property is an array, so process all values
$value = $_.TcpipNetbiosOptions
$TcpipNetbiosOptions_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "TcpipNetbiosOptions". The latter
# is defined by the hashtable in $TcpipNetbiosOptions:
Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -Property Caption, $TcpipNetbiosOptions
# ...or dump content of property TcpipNetbiosOptions:
$friendlyValues = Get-CimInstance -Class Win32_NetworkAdapterConfiguration |
Select-Object -Property $TcpipNetbiosOptions |
Select-Object -ExpandProperty TcpipNetbiosOptions
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $TcpipNetbiosOptions_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_NetworkAdapterConfiguration" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_NetworkAdapterConfiguration", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_NetworkAdapterConfiguration"
# to translate other properties, use their translation table instead
$TcpipNetbiosOptions_map = @{
0 = 'EnableNetbiosViaDhcp'
1 = 'EnableNetbios'
2 = 'DisableNetbios'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.TcpipNetbiosOptions
# translate raw value to friendly text:
$friendlyName = $TcpipNetbiosOptions_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "TcpipNetbiosOptions" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "TcpipNetbiosOptions", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "TcpipNetbiosOptions", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$TcpipNetbiosOptions = @{
Name = 'TcpipNetbiosOptions'
Expression = {
# property is an array, so process all values
$value = $_.TcpipNetbiosOptions
switch([int]$value)
{
0 {'EnableNetbiosViaDhcp'}
1 {'EnableNetbios'}
2 {'DisableNetbios'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration |
# ...and output properties "Caption" and "TcpipNetbiosOptions". The latter is defined
# by the hashtable in $TcpipNetbiosOptions:
Select-Object -Property Caption, $TcpipNetbiosOptions
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_NetworkAdapterConfiguration", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumTcpipNetbiosOptions
{
EnableNetbiosViaDhcp = 0
EnableNetbios = 1
DisableNetbios = 2
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_NetworkAdapterConfiguration | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.TcpipNetbiosOptions
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **TcpipNetbiosOptions**
[EnumTcpipNetbiosOptions]$rawValue
# get a comma-separated string:
[EnumTcpipNetbiosOptions]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumTcpipNetbiosOptions]
#endregion
Enums must cover all possible values. If TcpipNetbiosOptions returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
TcpMaxConnectRetransmissions
Number of times TCP attempts to retransmit a Connect Request before terminating the connection. The initial retransmission timeout is 3 seconds. The retransmission timeout doubles for each attempt. Default: 3, Valid Range: 0 - 0xFFFFFFFF.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, TcpMaxConnectRetransmissions
TcpMaxDataRetransmissions
Number of times TCP retransmits an individual data segment (nonconnect segment) before terminating the connection. The retransmission timeout doubles with each successive retransmission on a connection. Default: 5, Valid Range: 0 - 0xFFFFFFFF.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, TcpMaxDataRetransmissions
TcpNumConnections
Maximum number of connections that TCP can have open simultaneously. Default: 0xFFFFFE, Valid Range: 0 - 0xFFFFFE.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, TcpNumConnections
TcpUseRFC1122UrgentPointer
If TRUE, TCP uses the RFC 1122 specification for urgent data. If FALSE (default), TCP uses the mode used by Berkeley Software Design (BSD) derived systems. The two mechanisms interpret the urgent pointer differently and are not interoperable. The default value is FALSE.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, TcpUseRFC1122UrgentPointer
TcpWindowSize
Maximum TCP Receive Window size offered by the system. The Receive Window specifies the number of bytes a sender may transmit without receiving an acknowledgment. In general, larger receiving windows will improve performance over high-delay and high-bandwidth networks. For efficiency, the receiving window should be an even multiple of the TCP Maximum Segment Size (MSS). Default: Four times the maximum TCP data size or an even multiple of TCP data size rounded up to the nearest multiple of 8192. Ethernet networks default to 8760. Valid range: 0 - 65535.
Note
Windows® Vista: This property accesses the "CurrentControlSet\\Services\\Tcpip\\Parameters|TcpWindowSize"
registry entry, which is not used in the current implementation of the operating system.
®
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, TcpWindowSize
WINSEnableLMHostsLookup
If TRUE, local lookup files are used. Lookup files will contain a map of IP addresses to host names. If they exist on the local system, they will be found in %SystemRoot%\system32\drivers\etc.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, WINSEnableLMHostsLookup
WINSHostLookupFile
Path to a WINS lookup file on the local system. This file will contain a map of IP addresses to host names. If the file specified in this property is found, it will be copied to the %SystemRoot%\system32\drivers\etc folder of the local system. Valid only if the WINSEnableLMHostsLookup property is TRUE.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, WINSHostLookupFile
WINSPrimaryServer
IP address for the primary WINS server.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, WINSPrimaryServer
WINSScopeID
Value appended to the end of the NetBIOS name that isolates a group of computer systems communicating with only each other. It is used for all NetBIOS transactions over TCP/IP communications from that computer system. Computers configured with identical scope identifiers are able to communicate with this computer. TCP/IP clients with different scope identifiers disregard packets from computers with this scope identifier. Valid only when the EnableWINS method executes successfully.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, WINSScopeID
WINSSecondaryServer
IP address for the secondary WINS server.
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property Index, WINSSecondaryServer
Examples
List all instances of Win32_NetworkAdapterConfiguration
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration
Learn more about Get-CimInstance
and the deprecated Get-WmiObject
.
View all properties
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -Property *
View key properties only
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -KeyOnly
Selecting Properties
To select only some properties, pipe the results to Select-Object -Property a,b,c
with a comma-separated list of the properties you require. Wildcards are permitted.
Get-CimInstance
always returns all properties but only retrieves the ones that you specify. All other properties are empty but still present. That’s why you need to pipe the results into Select-Object
if you want to limit the visible properties, i.e. for reporting.
Selecting Properties
The code below lists all available properties. Remove the ones you do not need:
$properties = 'ArpAlwaysSourceRoute',
'ArpUseEtherSNAP',
'Caption',
'DatabasePath',
'DeadGWDetectEnabled',
'DefaultIPGateway',
'DefaultTOS',
'DefaultTTL',
'Description',
'DHCPEnabled',
'DHCPLeaseExpires',
'DHCPLeaseObtained',
'DHCPServer',
'DNSDomain',
'DNSDomainSuffixSearchOrder',
'DNSEnabledForWINSResolution',
'DNSHostName',
'DNSServerSearchOrder',
'DomainDNSRegistrationEnabled',
'ForwardBufferMemory',
'FullDNSRegistrationEnabled',
'GatewayCostMetric',
'IGMPLevel',
'Index',
'InterfaceIndex',
'IPAddress',
'IPConnectionMetric',
'IPEnabled',
'IPFilterSecurityEnabled',
'IPPortSecurityEnabled',
'IPSecPermitIPProtocols',
'IPSecPermitTCPPorts',
'IPSecPermitUDPPorts',
'IPSubnet',
'IPUseZeroBroadcast',
'IPXAddress',
'IPXEnabled',
'IPXFrameType',
'IPXMediaType',
'IPXNetworkNumber',
'IPXVirtualNetNumber',
'KeepAliveInterval',
'KeepAliveTime',
'MACAddress',
'MTU',
'NumForwardPackets',
'PMTUBHDetectEnabled',
'PMTUDiscoveryEnabled',
'ServiceName',
'SettingID',
'TcpipNetbiosOptions',
'TcpMaxConnectRetransmissions',
'TcpMaxDataRetransmissions',
'TcpNumConnections',
'TcpUseRFC1122UrgentPointer',
'TcpWindowSize',
'WINSEnableLMHostsLookup',
'WINSHostLookupFile',
'WINSPrimaryServer',
'WINSScopeID',
'WINSSecondaryServer'
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Select-Object -Property $properties
Limiting Network Bandwidth
If you work remotely, it makes sense to limit network bandwidth by filtering the properties on the server side, too:
Get-CimInstance -Class Win32_NetworkAdapterConfiguration -Property $property |
Select-Object -Property $property
Selecting Instances
To select some instances, use Get-CimInstance and a WMI Query. The wildcard character in WMI Queries is % (and not “*”).
The parameter -Filter runs a simple query.
Listing all instances where the property Caption starts with “A”
Get-CimInstance -Class Win32_NetworkAdapterConfiguration -Filter 'Caption LIKE "a%"'
Using a WQL Query
The parameter -Query uses a query similar to SQL and combines the parameters -Filter and -Property. This returns all instances where the property Caption starts with “A”, and returns the properties specified:
Get-CimInstance -Query "SELECT Description, DNSServerSearchOrder, DNSDomain, SettingID FROM Win32_NetworkAdapterConfiguration WHERE Caption LIKE 'a%'"
Any property you did not specify is still present but empty. You might need to use
Select-Object
to remove all unwanted properties:Get-CimInstance -Query "SELECT Description, DNSServerSearchOrder, DNSDomain, SettingID FROM Win32_NetworkAdapterConfiguration WHERE Caption LIKE 'a%'" | Select-Object -Property Description, DNSServerSearchOrder, DNSDomain, SettingID
Accessing Remote Computers
To access remote systems, you need to have proper permissions. User the parameter -ComputerName to access one or more remote systems.
Authenticating as Current User
# one or more computer names or IP addresses:
$list = 'server1', 'server2'
# authenticate with your current identity:
$result = Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -ComputerName $list
$result
Authenticating as Different User
Use a CIMSession object to authenticate with a new identity:
# one or more computer names or IP addresses:
$list = 'server1', 'server2'
# authenticate with a different identity:
$cred = Get-Credential -Message 'Authenticate to retrieve WMI information:'
$session = New-CimSession -ComputerName $list -Credential $cred
$result = Get-CimInstance Win32_NetworkAdapterConfiguration -CimSession $session
# remove the session after use (if you do not plan to re-use it later)
Remove-CimSession -CimSession $session
$result
Learn more about accessing remote computers.
Requirements
To use Win32_NetworkAdapterConfiguration, the following requirements apply:
PowerShell
Get-CimInstance
was introduced with PowerShell Version 3.0, which in turn was introduced on clients with Windows 8 and on servers with Windows Server 2012.
If necessary, update Windows PowerShell to Windows PowerShell 5.1, or install PowerShell 7 side-by-side.
Operating System
Win32_NetworkAdapterConfiguration was introduced on clients with Windows Vista and on servers with Windows Server 2008.
Namespace
Win32_NetworkAdapterConfiguration lives in the Namespace Root/CIMV2. This is the default namespace. There is no need to use the -Namespace parameter in Get-CimInstance
.
Implementation
Win32_NetworkAdapterConfiguration is implemented in CIMWin32.dll and defined in CIMWin32.mof. Both files are located in the folder C:\Windows\system32\wbem
:
explorer $env:windir\system32\wbem
notepad $env:windir\system32\wbem\CIMWin32.mof