schax [more=Enumerate Network Connections]
Код: Description Retrieves information about all active network connections found on a computer.
For more information about the Win32_NetworkConnection class used in this script, click
here.
Supported Platforms Windows Server 2003 Yes
Windows XP Yes
Windows 2000 Yes
Windows NT 4.0 Yes, with WMI installed
Script Code On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkConnection")
For Each objItem in colItems
Wscript.Echo "Access Mask: " & objItem.AccessMask
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Connection State: " & objItem.ConnectionState
Wscript.Echo "Connection Type: " & objItem.ConnectionType
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Display Type: " & objItem.DisplayType
Wscript.Echo "Local Name: " & objItem.LocalName
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Persistent: " & objItem.Persistent
Wscript.Echo "Provider Name: " & objItem.ProviderName
Wscript.Echo "Remote Name: " & objItem.RemoteName
Wscript.Echo "Remote Path: " & objItem.RemotePath
Wscript.Echo "Resource Type: " & objItem.ResourceType
Wscript.Echo "User Name: " & objItem.UserName
Wscript.Echo
Next