Log server Remote terminal 3389 login with batch processing _dos/bat

Source: Internet
Author: User
It is useful to have multiple users on the server or to see if there are other illegal users logged in.
In the D disk directory, create 2 Files "ts2003." BAT "(script files that are run when the user logs on) and" ts2003. Log file.
Write "ts2003." BAT script file:
Copy Code code 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, and "time/t" means to return to the system time, using the append symbol ">>" to put the time into the ts2003. Log as the Time field for the journal, the second line of code records the IP address of the end user, "netstat" is the command used to display the current network connection status, "-N" is used to display the IP and port, "-p TCP" displays the TCP protocol, and the pipe symbol "|" The result of the "netstat" command is output to the "find" command, and then the output is found containing the

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.