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;
};
Methods
The Win32_NetworkConnection class does not define any methods.
Properties
The Win32_NetworkConnection class defines the following 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.
| Value | Meaning |
- FILE_READ_DATA (file) FILE_LIST_DIRECTORY (directory)
- 0 (0x0)
|
Grants the right to read data from the file. For a directory, this value grants the right to list the contents of the directory.
|
- FILE_WRITE_DATA (file) FILE_ADD_FILE (directory)
- 1 (0x1)
|
Grants the right to write data to the file. For a directory, this value grants the right to create a file in the directory.
|
- FILE_APPEND_DATA (file) FILE_ADD_SUBDIRECTORY
- 4 (0x4)
|
Grants the right to append data to the file. For a directory, this value grants the right to create a subdirectory.
|
- FILE_READ_EA
- 8 (0x8)
|
Grants the right to read extended attributes.
|
- FILE_WRITE_EA
- 16 (0x10)
|
Grants the right to write extended attributes.
|
- FILE_EXECUTE (file) FILE_TRAVERSE (directory)
- 32 (0x20)
| Grants the right to execute a file. For a directory, the directory can be traversed.
|
- FILE_DELETE_CHILD
- 64 (0x40)
|
Grants the right to delete a directory and all of the files it contains (its children), even if the files are read-only.
|
- FILE_READ_ATTRIBUTES
- 128 (0x80)
|
Grants the right to read file attributes.
|
- FILE_WRITE_ATTRIBUTES
- 256 (0x100)
|
Grants the right to change file attributes.
|
- DELETE
- 65536 (0x10000)
|
Grants delete access.
|
- READ_CONTROL
- 131072 (0x20000)
| Grants read access to the security descriptor and owner.
|
- WRITE_DAC
- 262144 (0x40000)
|
Grants write access to the discretionary access control list (DACL).
|
- WRITE_OWNER
- 524288 (0x80000)
|
Assigns the write owner.
|
- SYNCHRONIZE
- 1048576 (0x100000)
|
Synchronizes access and allows a process to wait for an object to enter the signaled state.
|
- Caption
-
- Data type: string
- Access type: Read-only
Short description (one-line string) 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 |
| Minimum supported server | Windows 2000 Server |
| MOF | Cimwin32.mof |
| DLL | Cimwin32.dll |
| Namespace | \root\cimv2 |
See Also
- Operating System Classes
Send comments about this topic to Microsoft
Build date: 11/3/2009