Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Win32_NetworkConnection class

The Win32_NetworkConnectionWMI 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

[Provider("CIMWin32")]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. On FAT volumes, the FULL_ACCESS value is returned instead, indicating no security has been set on the object.

ValueMeaning
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 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

The following VBScript code sample retrieves information on the local network connection.


On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkConnection",,48)
For Each objItem in colItems
    Wscript.Echo "AccessMask: " & objItem.AccessMask
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "Comment: " & objItem.Comment
    Wscript.Echo "ConnectionState: " & objItem.ConnectionState
    Wscript.Echo "ConnectionType: " & objItem.ConnectionType
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "DisplayType: " & objItem.DisplayType
    Wscript.Echo "InstallDate: " & objItem.InstallDate
    Wscript.Echo "LocalName: " & objItem.LocalName
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Persistent: " & objItem.Persistent
    Wscript.Echo "ProviderName: " & objItem.ProviderName
    Wscript.Echo "RemoteName: " & objItem.RemoteName
    Wscript.Echo "RemotePath: " & objItem.RemotePath
    Wscript.Echo "ResourceType: " & objItem.ResourceType
    Wscript.Echo "Status: " & objItem.Status
    Wscript.Echo "UserName: " & objItem.UserName
Next

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

MOF

CIMWin32.mof

DLL

CIMWin32.dll

See also

Operating System Classes

 

 

Show:
© 2014 Microsoft