Question : list established tcp connections on remote server

Hi All.

I'm making a small administration application and given a server name / IP address, I would like to tell whether the remote server has established a connection on a given port.
Is there any programmatic way of doing this?
I don't mind running a remote netstat command with some params and pars the answer back on the administration server.
I'm using C# on a Windows Server 2003 with latest of everything...
Here's an example of what I'm looking for:
> myapp.exe remoteServerNmae 2048 [ENTER]
would return a list of all established TCP connections on "remoteServerName" where the listening port on that server is 2048.

Hope this is clear enough. I would be happy to answer any questions you might have regarding this subject.

Thanks!

Answer : list established tcp connections on remote server

start with http://www.microsoft.com/technet/scriptcenter/resources/wmifaq.mspx and http://msdn.microsoft.com/en-us/library/aa394582(VS.85).aspx

But I cannot find how to access netstat data via WMI... Not sure it's possible, sorry but I'm still searching.
If it is really impossible - you have to run own process on the remote machine, read open ports and send the data to your app.
Random Solutions  
 
programming4us programming4us