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.
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-onlyList 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-onlyShort description (one-line string) of the object.
- Comment
- Data type: string
Access type: Read-onlyComment 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-onlyPersistence type of the connection used for connecting to the network.
The values are:
- "Current Connection"
- "Persistent Connection"
- Description
- Data type: string
Access type: Read-onlyDescription of the object.
- DisplayType
- Data type: string
Access type: Read-onlyNetwork object should be displayed in a network browsing user interface.
The values are:
- "Domain"
- "Generic"
- "Server"
- "Share"
- InstallDate
- Data type: datetime
Access type: Read-onlyObject was installed. This property does not need a value to indicate that the object is installed.
- LocalName
- Data type: string
Access type: Read-onlyLocal name of the connected network device.
Example: "c:\public"
- Name
- Data type: string
Access type: Read-only
Qualifiers: KeyName 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-onlyConnection will be reconnected automatically by the operating system on the next logon.
- ProviderName
- Data type: string
Access type: Read-onlyName 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-onlyRemote 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-onlyFull path to the network resource.
Example: "\\infosrv1\public"
- ResourceType
- Data type: string
Access type: Read-onlyType of resource to enumerate or connect to.
The values are:
- "Disk"
- "Print"
- "Any"
- Status
- Data type: string
Access type: Read-onlyCurrent 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-onlyUser name or the default user name used to establish a network connection.
Example: "SYSTEM"
Remarks
The
Win32_NetworkConnection class is derived from CIM_LogicalElement.
Example Code
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
| Client | Requires Windows Vista, Windows XP, Windows 2000 Professional, or Windows NT Workstation 4.0 SP4 and later. |
| Server | Requires Windows Server 2008, Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0 SP4 and later. |
| MOF | Declared in Cimwin32.mof. |
| DLL | Requires Cimwin32.dll. |
| Namespace | Defined in \root\cimv2. |
See Also
Operating System Classes
Send comments about this topic to Microsoft
Build date: 6/19/2008