Get Netstat output from remote machine invoked by webserver

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jdimmerman
Posts: 1
Joined: 14 Jan 2012 09:49

Get Netstat output from remote machine invoked by webserver

#1 Post by jdimmerman » 14 Jan 2012 09:59

Hi,

I have been going crazy over the past two weeks trying to figure this out. We have various servers running windows server 2008 on our network and people are constantly using remote desktop from windows 7 to log onto these servers. My goal is to get the hostname currently logged into the servers over rdp from the webserver. (all of these servers/computers/webserver are on the same domain). This info is available using netstat called on the server that the hostname is logged into.

I have tried many methods, but the only that has worked out at all is using php to call shell_Exec to call "psexec \\server netstat -o". However, psexec hangs upon retrieving the output (this appears to be a known bug with calling psexec from a scripting language). I have also tried using WMI to get the active TCP/IP connections, but there doesn't seem to be a way to get the hostname/IP logged into the server using WMI (the localAddress column from netstat). Does anyone have any suggestions as to how I can get this done?

Thanks!

RogerSmith
Posts: 22
Joined: 20 Nov 2012 12:42

Re: Get Netstat output from remote machine invoked by webser

#2 Post by RogerSmith » 20 Nov 2012 14:13

hi

Code: Select all

net user


is this what you need?

type net help for more help

regards

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Get Netstat output from remote machine invoked by webser

#3 Post by Squashman » 20 Nov 2012 16:18

jdimmerman wrote:We have various servers running windows server 2008 on our network and people are constantly using remote desktop from windows 7 to log onto these servers.

You make it sound like they are not suppose to be doing this. If so then disallow it.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Get Netstat output from remote machine invoked by webser

#4 Post by foxidrive » 20 Nov 2012 22:33

The OP was a post from January.

Post Reply