Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use batch processing to record the login of server remote terminal 3389

Shulou Source: shulou.com Published: 2022-06-03 08:19:36 11月15日 Update

Editor to share with you how to use batch processing to record the login of the remote terminal 3389 of the server, I believe most people do not know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. let's learn about it!

It is useful if the server has multiple users or to see if other illegal users are logged in.

Under the D disk directory, create two files "ts2003.BAT" (the script file that the user runs when logging in) and "ts2003.LOG" (the log file).

Write a "ts2003.BAT" script file:

The code is as follows:

Time / t > > ts2003.log

Netstat-n-p tcp | find ": 3389" > > ts2003.log

Start Explorer

The first line of code is used to record the time the user logged in. "time / t" means to return the system time, using the appending symbol "> >" to record this time in "ts2003.LOG" as the log time field. The second line of code records the IP address of the end user. "netstat" is a command used to display the current network connection status, "- n" is used to display IP and port, "- p tcp" shows TCP protocol, pipe symbol "|" outputs the result of the "netstat" command to the "find" command, and then looks for the inclusion in the output. "

The above is all the contents of this article "how to use batch processing to record the login of the remote terminal 3389 of the server". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: User file time server terminal service code command article login situation login content log symbol result script output one line not much Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Redmi MySQL macOS vpn