Solved

Netstat function for Client computers on SBS 2003 network

Posted on 2006-10-31
4
410 Views
Last Modified: 2013-12-23
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
Comment
Question by:ajulianolmv
4 Comments
 
LVL 7

Accepted Solution

by:
CharliePete00 earned 133 total points
Comment Utility
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
 
LVL 5

Assisted Solution

by:cjtraman
cjtraman earned 133 total points
Comment Utility
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

FIPS stands for the Federal Information Processing Standardisation and FIPS 140-2 is a collection of standards that are generically associated with hardware and software cryptography. In most cases, people can refer to this as the method of encrypti…
Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now