• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 429
  • Last Modified:

Netstat function for Client computers on SBS 2003 network

Hi,

So i need to see the currently open connections on a couple client computers in our sbs 2003 domain.

Is there any easy way of doing this from server management?

I assume i could do something like TS into the client computer and then run netstat, but i'm not even sure it will give me all open connections on the machine.

any help is appreciated

-anthony
0
ajulianolmv
Asked:
ajulianolmv
2 Solutions
 
CharliePete00Commented:
A vbs/wmi script can help with that.  Below is an example.


On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("Computer1","Computer2")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ServerSession", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "ActiveTime: " & objItem.ActiveTime
      WScript.Echo "Caption: " & objItem.Caption
      WScript.Echo "ClientType: " & objItem.ClientType
      WScript.Echo "ComputerName: " & objItem.ComputerName
      WScript.Echo "Description: " & objItem.Description
      WScript.Echo "IdleTime: " & objItem.IdleTime
      WScript.Echo "InstallDate: " & WMIDateStringToDate(objItem.InstallDate)
      WScript.Echo "Name: " & objItem.Name
      WScript.Echo "ResourcesOpened: " & objItem.ResourcesOpened
      WScript.Echo "SessionType: " & objItem.SessionType
      WScript.Echo "Status: " & objItem.Status
      WScript.Echo "TransportName: " & objItem.TransportName
      WScript.Echo "UserName: " & objItem.UserName
      WScript.Echo
   Next
Next


Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm:
      WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
      Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
      & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now