Click to Rate and Give Feedback
MSDN
MSDN Library
WMI Reference
WMI Classes
Win32 Classes
Win32_NetworkAdapterConfiguration Class

The Win32_NetworkAdapterConfiguration WMI class represents the attributes and behaviors of a network adapter. This class includes extra properties and methods that support the management of the TCP/IP and Internetwork Packet Exchange (IPX) protocols that are independent from the network adapter.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties are listed in alphabetic order, not MOF order.

Syntax

class Win32_NetworkAdapterConfiguration : CIM_Setting
{
  boolean  ArpAlwaysSourceRoute;
  boolean  ArpUseEtherSNAP;
  string   Caption;
  string   DatabasePath;
  boolean  DeadGWDetectEnabled;
  string   DefaultIPGateway[];
  uint8    DefaultTOS;
  uint8    DefaultTTL;
  string   Description;
  boolean  DHCPEnabled;
  datetime DHCPLeaseExpires;
  datetime DHCPLeaseObtained;
  string   DHCPServer;
  string   DNSDomain;
  string   DNSDomainSuffixSearchOrder[];
  boolean  DNSEnabledForWINSResolution;
  string   DNSHostName;
  string   DNSServerSearchOrder[];
  boolean  DomainDNSRegistrationEnabled;
  uint32   ForwardBufferMemory;
  boolean  FullDNSRegistrationEnabled;
  uint16   GatewayCostMetric[];
  uint8    IGMPLevel;
  uint32   Index;
  uint32   InterfaceIndex;
  string   IPAddress[];
  uint32   IPConnectionMetric;
  boolean  IPEnabled;
  boolean  IPFilterSecurityEnabled;
  boolean  IPPortSecurityEnabled;
  string   IPSecPermitIPProtocols[];
  string   IPSecPermitTCPPorts[];
  string   IPSecPermitUDPPorts[];
  string   IPSubnet[];
  boolean  IPUseZeroBroadcast;
  string   IPXAddress;
  boolean  IPXEnabled;
  uint32   IPXFrameType[];
  uint32   IPXMediaType;
  string   IPXNetworkNumber[];
  string   IPXVirtualNetNumber;
  uint32   KeepAliveInterval;
  uint32   KeepAliveTime;
  string   MACAddress;
  uint32   MTU;
  uint32   NumForwardPackets;
  boolean  PMTUBHDetectEnabled;
  boolean  PMTUDiscoveryEnabled;
  string   ServiceName;
  string   SettingID;
  uint32   TcpipNetbiosOptions;
  uint32   TcpMaxConnectRetransmissions;
  uint32   TcpMaxDataRetransmissions;
  uint32   TcpNumConnections;
  boolean  TcpUseRFC1122UrgentPointer;
  uint16   TcpWindowSize;
  boolean  WINSEnableLMHostsLookup;
  string   WINSHostLookupFile;
  string   WINSPrimaryServer;
  string   WINSScopeID;
  string   WINSSecondaryServer;
};

Methods

The Win32_NetworkAdapterConfiguration class defines the following methods.

MethodDescription

DisableIPSec

Disables IP security 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 IP security globally across all IP-bound network adapters.

EnableIPSec

Enables IP security 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. This method is new for Windows XP.

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.

Windows 2000 with SP2 and earlier and Windows NT:  This method is not available.

SetIPUseZeroBroadcast

Sets IP zero broadcast usage.

SetIPXFrameTypeNetworkPairs

Starting with Windows Vista, the Internetwork Packet Exchange (IPX) technology is no longer supported and this method is obsolete.

Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0:  Sets IPX network number or frame pairs for this network adapter.

SetIPXVirtualNetworkNumber

Starting with Windows Vista, the Internetwork Packet Exchange (IPX) technology is no longer supported and this method is obsolete.

Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0:  Sets the Internetwork 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.

Windows 2000 and Windows NT 4.0:  This property is not available.

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.

 

Properties

The Win32_NetworkAdapterConfiguration class defines the following properties.

ArpAlwaysSourceRoute
Data type: boolean
Access type: Read-only

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.

ArpUseEtherSNAP
Data type: boolean
Access type: Read-only

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. Windows 2000 and Windows NT systems can receive both formats.

Caption
Data type: string
Access type: Read-only

Description of the CIM_Setting object—a one-line string. This property is inherited from CIM_Setting.

DatabasePath
Data type: string
Access type: Read-only

Valid Windows file path to standard Internet database files (HOSTS, LMHOSTS, NETWORKS, and PROTOCOLS). The file path is used by the Windows Sockets interface. This property is only available on computer systems running Windows 2000 and Windows NT.

DeadGWDetectEnabled
Data type: boolean
Access type: Read-only

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.

DefaultIPGateway
Data type: string array
Access type: Read-only

Array of IP addresses of default gateways that the computer system uses.

Example: "192.168.12.1 192.168.46.1"

DefaultTOS
Data type: uint8
Access type: Read-only

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.

DefaultTTL
Data type: uint8
Access type: Read-only

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.

Description
Data type: string
Access type: Read-only

Description of the CIM_Setting object. This property is inherited from CIM_Setting.

DHCPEnabled
Data type: boolean
Access type: Read-only

If TRUE, the dynamic host configuration protocol (DHCP) server automatically assigns an IP address to the computer system when establishing a network connection.

DHCPLeaseExpires
Data type: datetime
Access type: Read-only

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

DHCPLeaseObtained
Data type: datetime
Access type: Read-only

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

DHCPServer
Data type: string
Access type: Read-only

IP address of the dynamic host configuration protocol (DHCP) server.

Example: "10.55.34.2"

DNSDomain
Data type: string
Access type: Read-only

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"

DNSDomainSuffixSearchOrder
Data type: string array
Access type: Read-only

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"

DNSEnabledForWINSResolution
Data type: boolean
Access type: Read-only

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.

DNSHostName
Data type: string
Access type: Read-only

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"

DNSServerSearchOrder
Data type: string array
Access type: Read-only

Array of server IP addresses to be used in querying for DNS servers.

DomainDNSRegistrationEnabled
Data type: boolean
Access type: Read-only

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.

Windows 2000 and Windows NT 4.0:  This property is not available.
ForwardBufferMemory
Data type: uint32
Access type: Read-only
Qualifiers: Units(Bytes)

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).

FullDNSRegistrationEnabled
Data type: boolean
Access type: Read-only

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.

Windows 2000 and Windows NT 4.0:  This property is not available.
GatewayCostMetric
Data type: uint16 array
Access type: Read-only

Array of integer cost metric values (ranging from 1 to 9999) to be used in calculating the fastest, most reliable, or least expensive routes. This argument has a one-to-one correspondence with the DefaultIPGateway property.

Windows NT 4.0:  This property is not available.
IGMPLevel
Data type: uint8
Access type: Read-only

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.

ValueMeaning
0

No Multicast

1

IP Multicast

2

IP and IGMP Multicast (default)

 

Index
Data type: uint32
Access type: Read-only
Qualifiers: Key

Index number of the Windows network adapter configuration. The index number is used when there is more than one configuration available.

InterfaceIndex
Data type: uint32
Access type: Read-only

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.

Windows XP, Windows 2000, and Windows NT 4.0:  This property is not available.
IPAddress
Data type: string array
Access type: Read-only

Array of all of the IP addresses associated with the current network adapter. Starting with Windows Vista, 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"

Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0:  This property contains addresses in IPv4 format.

Example: "172.16.22.0"

IPConnectionMetric
Data type: uint32
Access type: Read-only

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.

Windows 2000 and Windows NT 4.0:  This property is not available.
IPEnabled
Data type: boolean
Access type: Read-only

If TRUE, TCP/IP is bound and enabled on this network adapter.

IPFilterSecurityEnabled
Data type: boolean
Access type: Read-only

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.

IPPortSecurityEnabled
Data type: boolean
Access type: Read-only
Qualifiers: Deprecated

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.

IPSecPermitIPProtocols
Data type: string array
Access type: Read-only

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.

IPSecPermitTCPPorts
Data type: string array
Access type: Read-only

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.

IPSecPermitUDPPorts
Data type: string array
Access type: Read-only

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.

IPSubnet
Data type: string array
Access type: Read-only

Array of all of the subnet masks associated with the current network adapter.

Example: "255.255.0.0"

IPUseZeroBroadcast
Data type: boolean
Access type: Read-only

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.

IPXAddress
Data type: string
Access type: Read-only

Starting with Windows Vista, the Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.

Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0:  Internetwork Packet Exchange (IPX) address of the network adapter. The IPX address identifies a computer system on a network using the IPX protocol.
IPXEnabled
Data type: boolean
Access type: Read-only

Starting with Windows Vista, the Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.

Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0:  If TRUE, the or Internetwork Packet Exchange (IPX) protocol is bound and enabled for this adapter.
IPXFrameType
Data type: uint32 array
Access type: Read-only

Starting with Windows Vista, the Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.

Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0:  Array of frame-type identifiers. The values in this array correspond to the elements in IPXNetworkNumber.
ValueMeaning
0

Ethernet II

1

Ethernet 802.3

2

Ethernet 802.2

3

Ethernet SNAP

255

AUTO

 

IPXMediaType
Data type: uint32
Access type: Read-only

Starting with Windows Vista, the Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.

Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0:  Internetwork Packet Exchange (IPX) media-type identifier.
ValueMeaning
1

Ethernet

2

Token Ring

3

FDDI

8

ARCNET

 

IPXNetworkNumber
Data type: string array
Access type: Read-only

Starting with Windows Vista, the Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.

Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0:  Array of characters that uniquely identifies a frame or network adapter combination on the computer system. The NetWare Link (NWLink) IPX/SPX-compatible transport in Windows 2000 and Windows NT 4.0 and later use two distinctly different types of network numbers. This number is sometimes referred to as the external network number. It must be unique for each network segment. The order in this string list will correspond item-for-item with the elements in the IPXFrameType property.
IPXVirtualNetNumber
Data type: string
Access type: Read-only

Starting with Windows Vista, the Internetwork Packet Exchange (IPX) technology is no longer supported and this property does not contain useful data.

Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0:  Unique identifier of the computer system on the network. It is represented in the form of an eight-character hexadecimal digit. Windows 2000 and Windows NT use the virtual network number (also known as an internal network number) for internal routing.
KeepAliveInterval
Data type: uint32
Access type: Read-only
Qualifiers: Units(Milliseconds)

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.

KeepAliveTime
Data type: uint32
Access type: Read-only
Qualifiers: Units(Milliseconds)

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).

MACAddress
Data type: string
Access type: Read-only

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"

MTU
Data type: uint32
Access type: Read-only
Qualifiers: Units(Bytes)

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.

NumForwardPackets
Data type: uint32
Access type: Read-only

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.

PMTUBHDetectEnabled
Data type: boolean
Access type: Read-only

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.

PMTUDiscoveryEnabled
Data type: boolean
Access type: Read-only

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.

ServiceName
Data type: string
Access type: Read-only

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

Example: "Elnkii"

SettingID
Data type: string
Access type: Read-only

Identifier by which the CIM_Setting object is known. This property is inherited from CIM_Setting.

TcpipNetbiosOptions
Data type: uint32
Access type: Read-only

Bitmap of the possible settings related to NetBIOS over TCP/IP.

Windows 2000 and Windows NT 4.0:  This property is not available.
Values are identified in the following table.
Value (Dec/Hex)Meaning
0 0x0

EnableNetbiosViaDhcp

1 0x1

EnableNetbios

2 0x2

DisableNetbios

 

TcpMaxConnectRetransmissions
Data type: uint32
Access type: Read-only

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.

TcpMaxDataRetransmissions
Data type: uint32
Access type: Read-only

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.

TcpNumConnections
Data type: uint32
Access type: Read-only

Maximum number of connections that TCP can have open simultaneously. Default: 0xFFFFFE, Valid Range: 0 - 0xFFFFFE.

TcpUseRFC1122UrgentPointer
Data type: boolean
Access type: Read-only

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 TRUE.

TcpWindowSize
Data type: uint16
Access type: Read-only
Qualifiers: Units(Bytes)

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.

WINSEnableLMHostsLookup
Data type: boolean
Access type: Read-only

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.

WINSHostLookupFile
Data type: string
Access type: Read-only

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.

WINSPrimaryServer
Data type: string
Access type: Read-only

IP address for the primary WINS server.

WINSScopeID
Data type: string
Access type: Read-only

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.

WINSSecondaryServer
Data type: string
Access type: Read-only

IP address for the secondary WINS server.

Remarks

The Win32_NetworkAdapterConfiguration class is derived from CIM_Setting.

Examples

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

For C++ code examples, see WMI C++ Application Examples.

The following example returns all of the information from the Win32_NetworkAdapterConfiguration class.

strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" _
    & strComputer & "\root\CIMV2") 
Set colItems = objWMIService.ExecQuery( _
    "SELECT * FROM Win32_NetworkAdapterConfiguration",,48) 
For Each objItem in colItems 
    Wscript.Echo "-----------------------------------"
    Wscript.Echo "Win32_NetworkAdapterConfiguration instance"
    Wscript.Echo "-----------------------------------"
    Wscript.Echo "ArpAlwaysSourceRoute: " _
        & objItem.ArpAlwaysSourceRoute
    Wscript.Echo "ArpUseEtherSNAP: " & objItem.ArpUseEtherSNAP
    Wscript.Echo "DatabasePath: " & objItem.DatabasePath
    Wscript.Echo "DeadGWDetectEnabled: " _
        & objItem.DeadGWDetectEnabled
    Wscript.Echo "DefaultIPGateway: " & strDefaultIPGateway
    Wscript.Echo "DefaultTOS: " & objItem.DefaultTOS
    Wscript.Echo "DefaultTTL: " & objItem.DefaultTTL
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "DHCPEnabled: " & objItem.DHCPEnabled
    Wscript.Echo "DHCPLeaseExpires: " & objItem.DHCPLeaseExpires
    Wscript.Echo "DHCPLeaseObtained: " & objItem.DHCPLeaseObtained
    Wscript.Echo "DHCPServer: " & objItem.DHCPServer
    Wscript.Echo "DNSDomain: " & objItem.DNSDomain
    Wscript.Echo "DNSDomainSuffixSearchOrder: " _
        & strDNSDomainSuffixSearchOrder
    Wscript.Echo "DNSEnabledForWINSResolution: " _
        & objItem.DNSEnabledForWINSResolution
    Wscript.Echo "DNSHostName: " & objItem.DNSHostName
    Wscript.Echo "DNSServerSearchOrder: " _
        & strDNSServerSearchOrder
    Wscript.Echo "DomainDNSRegistrationEnabled: " _
        & objItem.DomainDNSRegistrationEnabled
    Wscript.Echo "ForwardBufferMemory: " _
        & objItem.ForwardBufferMemory
    Wscript.Echo "FullDNSRegistrationEnabled: " _
        & objItem.FullDNSRegistrationEnabled
    Wscript.Echo "GatewayCostMetric: " & strGatewayCostMetric
    Wscript.Echo "IGMPLevel: " & objItem.IGMPLevel
    Wscript.Echo "Index: " & objItem.Index
    Wscript.Echo "IPAddress: " & strIPAddress
    Wscript.Echo "IPConnectionMetric: " _
        & objItem.IPConnectionMetric
    Wscript.Echo "IPEnabled: " & objItem.IPEnabled
    Wscript.Echo "IPFilterSecurityEnabled: " _
        & objItem.IPFilterSecurityEnabled
    Wscript.Echo "IPPortSecurityEnabled: " _
        & objItem.IPPortSecurityEnabled
    Wscript.Echo "IPSecPermitIPProtocols: " _
        & strIPSecPermitIPProtocols
    Wscript.Echo "IPSecPermitTCPPorts: " _
        & strIPSecPermitTCPPorts
    Wscript.Echo "IPSecPermitUDPPorts: " _
        & strIPSecPermitUDPPorts
    Wscript.Echo "IPSubnet: " & strIPSubnet
    Wscript.Echo "IPUseZeroBroadcast: " _
        & objItem.IPUseZeroBroadcast
    Wscript.Echo "IPXAddress: " & objItem.IPXAddress
    Wscript.Echo "IPXEnabled: " & objItem.IPXEnabled
    Wscript.Echo "IPXFrameType: " & strIPXFrameType
    Wscript.Echo "IPXNetworkNumber: " & strIPXNetworkNumber
    Wscript.Echo "IPXVirtualNetNumber: " _
        & objItem.IPXVirtualNetNumber
    Wscript.Echo "KeepAliveInterval: " _
        & objItem.KeepAliveInterval
    Wscript.Echo "KeepAliveTime: " & objItem.KeepAliveTime
    Wscript.Echo "MACAddress: " & objItem.MACAddress
    Wscript.Echo "MTU: " & objItem.MTU
    Wscript.Echo "NumForwardPackets: " _
        & objItem.NumForwardPackets
    Wscript.Echo "PMTUBHDetectEnabled: " _
        & objItem.PMTUBHDetectEnabled
    Wscript.Echo "PMTUDiscoveryEnabled: " _
        & objItem.PMTUDiscoveryEnabled
    Wscript.Echo "ServiceName: " & objItem.ServiceName
    Wscript.Echo "SettingID: " & objItem.SettingID
    Wscript.Echo "TcpipNetbiosOptions: " _
        & objItem.TcpipNetbiosOptions
    Wscript.Echo "TcpMaxConnectRetransmissions: " _
        & objItem.TcpMaxConnectRetransmissions
    Wscript.Echo "TcpMaxDataRetransmissions: " _
        & objItem.TcpMaxDataRetransmissions
    Wscript.Echo "TcpNumConnections: " _
        & objItem.TcpNumConnections
    Wscript.Echo "TcpUseRFC1122UrgentPointer: " _
        & objItem.TcpUseRFC1122UrgentPointer
    Wscript.Echo "TcpWindowSize: " & objItem.TcpWindowSize
    Wscript.Echo "WINSEnableLMHostsLookup: " _
        & objItem.WINSEnableLMHostsLookup
    Wscript.Echo "WINSHostLookupFile: " _
        & objItem.WINSHostLookupFile
    Wscript.Echo "WINSPrimaryServer: " _
        & objItem.WINSPrimaryServer
    Wscript.Echo "WINSScopeID: " & objItem.WINSScopeID
    Wscript.Echo "WINSSecondaryServer: " _
        & objItem.WINSSecondaryServer
Next

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
MOFCimwin32.mof
DLLCimwin32.dll
Namespace\root\cimv2

See Also

Computer System Hardware Classes

Send comments about this topic to Microsoft

Build date: 11/3/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Script to get comprehensive nic info      David I McIntosh ... silvio3d   |   Edit   |   Show History
sub appendCollection(msg, colctn, nm)
i=0
for each t in colctn
msg = msg & "nic." & nm & "["&i&"]: " & t & vbCRLF
i = i + 1
next
end sub

strComputer = "."


Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colNicConfigs = objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

for each nic in colNicConfigs
msg = "nic.ArpAlwaysSourceRoute: " & nic.ArpAlwaysSourceRoute & vbCRLF _
& "nic.ArpUseEtherSNAP: " & nic.ArpUseEtherSNAP & vbCRLF _
& "nic.Caption: " & nic.Caption & vbCRLF _
& "nic.DatabasePath: " & nic.DatabasePath & vbCRLF _
& "nic.DeadGWDetectEnabled: " & nic.DeadGWDetectEnabled & vbCRLF _
& "nic.DefaultTOS: " & nic.DefaultTOS & vbCRLF _
& "nic.DefaultTTL: " & nic.DefaultTTL & vbCRLF _
& "nic.Description: " & nic.Description & vbCRLF _
& "nic.DHCPEnabled: " & nic.DHCPEnabled & vbCRLF _
& "nic.DHCPLeaseExpires: " & nic.DHCPLeaseExpires & vbCRLF _
& "nic.DHCPLeaseObtained: " & nic.DHCPLeaseObtained & vbCRLF _
& "nic.DHCPServer: " & nic.DHCPServer & vbCRLF _
& "nic.DNSDomain: " & nic.DNSDomain & vbCRLF _
& "nic.DNSEnabledForWINSResolution: " & nic.DNSEnabledForWINSResolution & vbCRLF _
& "nic.DNSHostName: " & nic.DNSHostName & vbCRLF _
& "nic.DomainDNSRegistrationEnabled: " & nic.DomainDNSRegistrationEnabled & vbCRLF _
& "nic.DNSDomainSuffixSearchOrder: " & nic.DNSDomainSuffixSearchOrder & vbCRLF _
& "nic.ForwardBufferMemory: " & nic.ForwardBufferMemory & vbCRLF _
& "nic.FullDNSRegistrationEnabled: " & nic.FullDNSRegistrationEnabled & vbCRLF _
& "nic.IGMPLevel: " & nic.IGMPLevel & vbCRLF _
& "nic.Index: " & nic.Index & vbCRLF _
& "nic.IPConnectionMetric: " & nic.IPConnectionMetric & vbCRLF _
& "nic.IPEnabled: " & nic.IPEnabled & vbCRLF _
& "nic.IPFilterSecurityEnabled: " & nic.IPFilterSecurityEnabled & vbCRLF _
& "nic.IPPortSecurityEnabled: " & nic.IPPortSecurityEnabled & vbCRLF _
& "nic.IPUseZeroBroadcast: " & nic.IPUseZeroBroadcast & vbCRLF _
& "nic.IPXAddress: " & nic.IPXAddress & vbCRLF _
& "nic.IPXEnabled: " & nic.IPXEnabled & vbCRLF _
& "nic.IPXFrameType: " & nic.IPXFrameType & vbCRLF _
& "nic.IPXMediaType: " & nic.IPXMediaType & vbCRLF _
& "nic.IPXNetworkNumber: " & nic.IPXNetworkNumber & vbCRLF _
& "nic.IPXVirtualNetNumber: " & nic.IPXVirtualNetNumber & vbCRLF _
& "nic.KeepAliveInterval: " & nic.KeepAliveInterval & vbCRLF _
& "nic.KeepAliveTime: " & nic.KeepAliveTime & vbCRLF _
& "nic.MACAddress: " & nic.MACAddress & vbCRLF _
& "nic.MTU: " & nic.MTU & vbCRLF _
& "nic.NumForwardPackets: " & nic.NumForwardPackets & vbCRLF _
& "nic.PMTUBHDetectEnabled: " & nic.PMTUBHDetectEnabled & vbCRLF _
& "nic.PMTUDiscoveryEnabled: " & nic.PMTUDiscoveryEnabled & vbCRLF _
& "nic.ServiceName: " & nic.ServiceName & vbCRLF _
& "nic.SettingID: " & nic.SettingID & vbCRLF _
& "nic.TcpipNetbiosOptions: " & nic.TcpipNetbiosOptions & vbCRLF _
& "nic.TcpMaxConnectRetransmissions: " & nic.TcpMaxConnectRetransmissions & vbCRLF _
& "nic.TcpMaxDataRetransmissions: " & nic.TcpMaxDataRetransmissions & vbCRLF _
& "nic.TcpNumConnections: " & nic.TcpNumConnections & vbCRLF _
& "nic.TcpUseRFC1122UrgentPointer: " & nic.TcpUseRFC1122UrgentPointer & vbCRLF _
& "nic.TcpWindowSize: " & nic.TcpWindowSize & vbCRLF _
& "nic.WINSEnableLMHostsLookup: " & nic.WINSEnableLMHostsLookup & vbCRLF _
& "nic.WINSHostLookupFile: " & nic.WINSHostLookupFile & vbCRLF _
& "nic.WINSPrimaryServer: " & nic.WINSPrimaryServer & vbCRLF _
& "nic.WINSScopeID: " & nic.WINSScopeID & vbCRLF _
& "nic.WINSSecondaryServer: " & nic.WINSSecondaryServer & vbCRLF _
'& "nic.InterfaceIndex: " & "|"&nic.InterfaceIndex & vbCRLF _

appendCollection msg, nic.DefaultIPGateway, "DefaultIPGateway"
appendCollection msg, nic.DNSServerSearchOrder, "DNSServerSearchOrder"
appendCollection msg, nic.GatewayCostMetric, "GatewayCostMetric"
appendCollection msg, nic.IPAddress, "IPAddress"
appendCollection msg, nic.IPSecPermitIPProtocols, "IPSecPermitIPProtocols"
appendCollection msg, nic.IPSecPermitTCPPorts, "IPSecPermitTCPPorts"
appendCollection msg, nic.IPSecPermitUDPPorts, "IPSecPermitUDPPorts"
appendCollection msg, nic.IPSubnet, "IPSubnet"

WScript.Echo msg
next

'Vista only code???
'Set colAdapters = objWMIService.Execquery ("SELECT * FROM Win32_NetworkAdapter WHERE NetEnabled = True")
'For Each nic in colAdapters
' msg = "nic.DeviceId: " & nic.DeviceId & vbCRLF _
' & "nic.Name: " & nic.Name & vbCRLF _
'
'Next

IPEnabled in Windows 2003 and 2008      ucthakur ... ssuth9   |   Edit   |   Show History

I noticed that when you IPEnabled for each adapter on server 2003 will return True whether they are connected or not.

however, on windows 2008, only those adapters taht are connected will have IPEnabled set to True.

"however, on windows 2008, only those adapters that are connected will have IPEnabled set to True."

Flag as ContentBug
TcpipNetbiosOptions on Windows 2000      GroVoiRi   |   Edit   |   Show History
TcpipNetbiosOptions
Data type: uint32
Access type: Read-only

Bitmap of the possible settings related to NetBIOS over TCP/IP.

Windows 2000 and Windows NT 4.0: This property is not available.
FALSE
Windows 2000 sp4: This property IS available.
Tags What's this?: Add a tag
Flag as ContentBug
Fixed MSDN Sample      Marianok   |   Edit   |   Show History

The original Sample Code in the MSDN site is missing the assignment of all the information contained in arrays (including IP addresses, Subnets, DNS Lookup order, etc).

This is the very same code, I just added the missing assignments.




on error resume next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" _
& strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_NetworkAdapterConfiguration",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"
Wscript.Echo "Win32_NetworkAdapterConfiguration instance"
Wscript.Echo "-----------------------------------"
Wscript.Echo "ArpAlwaysSourceRoute: " & vbtab _
& objItem.ArpAlwaysSourceRoute
Wscript.Echo "ArpUseEtherSNAP: " & vbtab & objItem.ArpUseEtherSNAP
Wscript.Echo "DatabasePath: " & vbtab & objItem.DatabasePath
Wscript.Echo "DeadGWDetectEnabled: " & vbtab _
& objItem.DeadGWDetectEnabled


strDefaultIPGateway = Join(objitem.DefaultIPGateway, ",")


Wscript.Echo "DefaultIPGateway: " & vbtab & strDefaultIPGateway
Wscript.Echo "DefaultTOS: " & vbtab & objItem.DefaultTOS
Wscript.Echo "DefaultTTL: " & vbtab & objItem.DefaultTTL
Wscript.Echo "Description: " & vbtab & objItem.Description
Wscript.Echo "DHCPEnabled: " & vbtab & objItem.DHCPEnabled
Wscript.Echo "DHCPLeaseExpires: " & vbtab & objItem.DHCPLeaseExpires
Wscript.Echo "DHCPLeaseObtained: " & vbtab & objItem.DHCPLeaseObtained
Wscript.Echo "DHCPServer: " & vbtab & objItem.DHCPServer
Wscript.Echo "DNSDomain: " & vbtab & objItem.DNSDomain


strDNSDomainSuffixSearchOrder = Join(objitem.DNSDomainSuffixSearchOrder, ",")


Wscript.Echo "DNSDomainSuffixSearchOrder: " & vbtab _
& strDNSDomainSuffixSearchOrder
Wscript.Echo "DNSEnabledForWINSResolution: " & vbtab _
& objItem.DNSEnabledForWINSResolution
Wscript.Echo "DNSHostName: " & vbtab & objItem.DNSHostName


strDNSServerSearchOrder = Join(objitem.DNSServerSearchOrder, ",")


Wscript.Echo "DNSServerSearchOrder: " & vbtab _
& strDNSServerSearchOrder
Wscript.Echo "DomainDNSRegistrationEnabled: " & vbtab _
& objItem.DomainDNSRegistrationEnabled
Wscript.Echo "ForwardBufferMemory: " & vbtab _
& objItem.ForwardBufferMemory
Wscript.Echo "FullDNSRegistrationEnabled: " & vbtab _
& objItem.FullDNSRegistrationEnabled


strGatewayCostMetric = Join(objitem.GatewayCostMetric, ",")


Wscript.Echo "GatewayCostMetric: " & vbtab & strGatewayCostMetric
Wscript.Echo "IGMPLevel: " & vbtab & objItem.IGMPLevel
Wscript.Echo "Index: " & vbtab & objItem.Index


strIPAddress=Join(objitem.IPAddress, ",")


Wscript.Echo "IPAddress: " & vbtab & strIPAddress
Wscript.Echo "IPConnectionMetric: " & vbtab _
& objItem.IPConnectionMetric
Wscript.Echo "IPEnabled: " & vbtab & objItem.IPEnabled
Wscript.Echo "IPFilterSecurityEnabled: " & vbtab _
& objItem.IPFilterSecurityEnabled
Wscript.Echo "IPPortSecurityEnabled: " & vbtab _
& objItem.IPPortSecurityEnabled


strIPSecPermitIPProtocols = Join(objitem.IPSecPermitIPProtocols, ",")


Wscript.Echo "IPSecPermitIPProtocols: " & vbtab _
& strIPSecPermitIPProtocols


strIPSecPermitTCPPorts =Join(objitem.IPSecPermitTCPPorts, ",")


Wscript.Echo "IPSecPermitTCPPorts: " & vbtab _
& strIPSecPermitTCPPorts


strIPSecPermitUDPPorts = Join(objitem.IPSecPermitUDPPorts, ",")


Wscript.Echo "IPSecPermitUDPPorts: " & vbtab _
& strIPSecPermitUDPPorts


strIPSubnet = Join(objitem.IPSubnet, ",")


Wscript.Echo "IPSubnet: " & vbtab & strIPSubnet
Wscript.Echo "IPUseZeroBroadcast: " & vbtab _
& objItem.IPUseZeroBroadcast
Wscript.Echo "IPXAddress: " & vbtab & objItem.IPXAddress
Wscript.Echo "IPXEnabled: " & vbtab & objItem.IPXEnabled


strIPXFrameType=Join(objitem.IPXFrameType, ",")


Wscript.Echo "IPXFrameType: " & vbtab & strIPXFrameType


strIPXNetworkNumber=Join(objitem.IPXNetworkNumber, ",")


Wscript.Echo "IPXNetworkNumber: " & vbtab & strIPXNetworkNumber
Wscript.Echo "IPXVirtualNetNumber: " & vbtab _
& objItem.IPXVirtualNetNumber
Wscript.Echo "KeepAliveInterval: " & vbtab _
& objItem.KeepAliveInterval
Wscript.Echo "KeepAliveTime: " & vbtab & objItem.KeepAliveTime
Wscript.Echo "MACAddress: " & vbtab & objItem.MACAddress
Wscript.Echo "MTU: " & vbtab & objItem.MTU
Wscript.Echo "NumForwardPackets: " & vbtab _
& objItem.NumForwardPackets
Wscript.Echo "PMTUBHDetectEnabled: " & vbtab _
& objItem.PMTUBHDetectEnabled
Wscript.Echo "PMTUDiscoveryEnabled: " & vbtab _
& objItem.PMTUDiscoveryEnabled
Wscript.Echo "ServiceName: " & vbtab & objItem.ServiceName
Wscript.Echo "SettingID: " & vbtab & objItem.SettingID
Wscript.Echo "TcpipNetbiosOptions: " & vbtab _
& objItem.TcpipNetbiosOptions
Wscript.Echo "TcpMaxConnectRetransmissions: " & vbtab _
& objItem.TcpMaxConnectRetransmissions
Wscript.Echo "TcpMaxDataRetransmissions: " & vbtab _
& objItem.TcpMaxDataRetransmissions
Wscript.Echo "TcpNumConnections: " & vbtab _
& objItem.TcpNumConnections
Wscript.Echo "TcpUseRFC1122UrgentPointer: " & vbtab _
& objItem.TcpUseRFC1122UrgentPointer
Wscript.Echo "TcpWindowSize: " & vbtab & objItem.TcpWindowSize
Wscript.Echo "WINSEnableLMHostsLookup: " & vbtab _
& objItem.WINSEnableLMHostsLookup
Wscript.Echo "WINSHostLookupFile: " & vbtab _
& objItem.WINSHostLookupFile
Wscript.Echo "WINSPrimaryServer: " & vbtab _
& objItem.WINSPrimaryServer
Wscript.Echo "WINSScopeID: " & vbtab & objItem.WINSScopeID
Wscript.Echo "WINSSecondaryServer: " & vbtab _
& objItem.WINSSecondaryServer
Next

Tags What's this?: Add a tag
Flag as ContentBug
Forget all that!!!      OxG   |   Edit   |   Show History

OK, never mind the scripts above.
Here is something that'll make ya smile. It will make yer life much more tolerable...
Pass any WMI object to this sub, and you will get a beautiful formatted list of all methods, properties, and values.
It's a thing of beauty, I wish all objects hads this ability...

Don't say I never did anything for ya.
One thing you will have to do fer yerself: open a log file with the handle: oLog
Oh yes, yer most welcome...

PS: Some values such as MTU don't work pre-Vista. That is not reflected in these docs (nice!), but can be discovered with a few google searches.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Function: ObjDump

' Description: Dumps attributes of a WMI object

' Syntax: ObjDump ( O_Mystery)

' Return: none

' Parameters: o_Mystery - object to analyse

' Globals: oLog - File handle to debug file
' Note: I had to fight with the web software to get this code to format properly
' hence the lines with empty quotes. Grrr!




''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Sub ObjDump ( ByRef o_Mystery)
Dim o_Temp ' loop iteration
Dim s_Tr ' build string...
Dim i_Len ' could be negative
'







ON ERROR RESUME NEXT
'


' first: properties_ See this page: http://msdn.microsoft.com/en-us/library/aa393741.aspx
For Each o_Temp In o_Mystery.Properties
' wimpy formatting stuff_
s_Tr = "Property name ->" & o_Temp.Name & "<"
i_Len = 40 - Len ( s_Tr)
If i_Len < 0 Then i_Len = 60 - Len ( s_Tr)
oLog.Write s_Tr & Space ( i_Len)
'

' yup, the following is a property of this object class!
If o_Temp.IsArray Then
If IsNull ( o_Temp.Value) Then
oLog.WriteLine vbTab & "Value ->NULL<"
Else
oLog.WriteLine vbTab & "Value ->>" & Join ( o_Temp.Value, "< >") & "<<"
End If
'
ElseIF IsNull ( o_Temp.Value) Then
oLog.WriteLine vbTab & "Value ->NULL<"
'


Else
oLog.WriteLine vbTab & "Value ->" & o_Temp.Value & "<"
End If
Next
'

' then methods_
For Each o_Temp In o_Mystery.Methods_
' if you can figure out how to get paramater names (or even just a count) please let fly...
oLog.Write "Method name ->" & o_Temp.Name & "<"
Next

'
Err.Clear
ON ERROR GOTO 0

End Sub
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker