Win32_NetworkConnection class
The Win32_NetworkConnection WMI class represents an active network connection in a Windows-based environment.
The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties and methods are in alphabetic order, not MOF order.
Syntax
class Win32_NetworkConnection : CIM_LogicalElement
{
uint32 AccessMask[];
string Caption;
string Comment;
string ConnectionState;
string ConnectionType;
string Description;
string DisplayType;
datetime InstallDate;
string LocalName;
string Name;
boolean Persistent;
string ProviderName;
string RemoteName;
string RemotePath;
string ResourceType;
string Status;
string UserName;
};
Members
The Win32_NetworkConnection class has these types of members:
Properties
The Win32_NetworkConnection class has these properties.
- AccessMask
-
- Data type: uint32 array
- Access type: Read-only
List of access rights to the given file or directory held by the user or group on whose behalf the instance is returned. This property is only supported under Windows 2000 and Windows NT. On Windows 98 and on Windows 2000 of Windows NT FAT volumes, the FULL_ACCESS value is returned instead, indicating no security has been set on the object.
- Caption
-
- Data type: string
- Access type: Read-only
Short description of the object.
- Comment
-
- Data type: string
- Access type: Read-only
Comment supplied by the network provider.
- ConnectionState
-
- Data type: string
- Access type: Read-only
- Qualifiers: MaxLen (20)
Current state of the network connection.
The values are:
- "Connected"
- "Error"
- "Paused"
- "Disconnected"
- "Connecting"
- "Reconnecting"
- ConnectionType
-
- Data type: string
- Access type: Read-only
Persistence type of the connection used for connecting to the network.
The values are:
- "Current Connection"
- "Persistent Connection"
- Description
-
- Data type: string
- Access type: Read-only
Description of the object.
- DisplayType
-
- Data type: string
- Access type: Read-only
Network object should be displayed in a network browsing user interface.
The values are:
- "Domain"
- "Generic"
- "Server"
- "Share"
- InstallDate
-
- Data type: datetime
- Access type: Read-only
Object was installed. This property does not need a value to indicate that the object is installed.
- LocalName
-
- Data type: string
- Access type: Read-only
Local name of the connected network device.
Example: "c:\public"
- Name
-
- Data type: string
- Access type: Read-only
- Qualifiers: Key
Name of the current network connection. It is the combination of the values in RemoteName and LocalName.
Example: "\\NTRELEASE (c:\public)"
- Persistent
-
- Data type: boolean
- Access type: Read-only
Connection will be reconnected automatically by the operating system on the next logon.
- ProviderName
-
- Data type: string
- Access type: Read-only
Name of the provider that owns the resource. This property can be NULL if the provider name is unknown.
- RemoteName
-
- Data type: string
- Access type: Read-only
Remote network resource name for a network resource. For a current or persistent connection, RemoteName contains the network name associated with the name of the value in the LocalName property. The name in RemoteName must follow the network provider's naming conventions.
Example: "\\NTRELEASE"
- RemotePath
-
- Data type: string
- Access type: Read-only
Full path to the network resource.
Example: "\\infosrv1\public"
- ResourceType
-
- Data type: string
- Access type: Read-only
Type of resource to enumerate or connect to.
The values are:
- "Disk"
- "Print"
- "Any"
- Status
-
- Data type: string
- Access type: Read-only
Current status of the object. Various operational and nonoperational statuses can be defined. Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is online, yet the managed element is neither "OK" nor in one of the other states.
The values are:
- "OK"
- "Error"
- "Degraded"
- "Unknown"
- "Pred Fail"
- "Starting"
- "Stopping"
- "Service"
- "Stressed"
- "NonRecover"
- "No Contact"
- "Lost Comm"
- UserName
-
- Data type: string
- Access type: Read-only
User name or the default user name used to establish a network connection.
Example: "SYSTEM"
Remarks
The Win32_NetworkConnection class is derived from CIM_LogicalElement.
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.
Requirements
|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server | Windows 2000 Server [desktop apps only] |
|
Namespace |
\root\CIMV2 |
|
MOF |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 11/19/2012