简体   繁体   中英

Get list of remote clients from a remote server

I want to get al the clients (IP addresses + pcname) connected to a specific server remotely.

Situation sketch

I have 40 servers and 1000 clients on the same netwerk.

192.168.1.99 = server 1
192.168.2.99 = server 2
etc.

Every server has clients

192.168.1.2 = client 2 on server 1
192.168.1.3 = client 3 on server 1
etc.

Me on my pc (PC1) on the same network want to ask server with IP: 192.168.30.99 (server 30 ) what clients are logged/connected

The server ( 192.168.30.99 ) should send me a list with these IP addresses (of the clients) and their pc name.

Any idea anybody? I want to do this remotely.

  • I have admin passwords to all the servers and clients.
  • I have looked in WMI but no such luck
  • I am using Windows Server 2012 on the servers.

wmic /node:OtherServerName process call create "cmd.exe /c netstat.exe -n"

You can use -a to force name resolutions (will be much slower and may not work in a prod environment)

There are policy objects and many good things in place that should stop you from having this work by default.

You can replace OtherServerName with localhost to see it run on your local computer. There are many real issues that still come up such as how you will pipe the results etc.

piping example that should work...

wmic /node:OtherServerName process call create "cmd.exe /c netstat.exe -n" >> C:\\MyFiles\\SomeServer.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM