Experts answer the network management FAQ: How to remotely restart the server

  

I am a network administrator, recently installed the Windows 2003 server operating system on one, and through his remote desktop function control. However, due to the work requirements, I need to restart the server every time I operate on the server to make the modification settings take effect. However, every time I successfully connect to the remote desktop and restart, I find that the operation is invalid. I am disconnected from the server. Connection, but the server is still on the desktop state, using the ping command to test connectivity and found that it has not been broken, actually went to the machine room and saw that there was no restart. So I would like to ask if the remote desktop component does not have the ability to restart the server? Thank you for your answer! ! !

[answer] in fact windows 2003 server Remote Desktop feature is very powerful, he can help us carry out various operations, modify settings, as in the server operating the machine. Of course, there is no problem with shutting down the computer, restarting the computer, and logging out. Therefore, the problem encountered by the above netizen should be the failure of the server itself rather than the remote desktop itself.

according to the users of the tips that we can know when he finished operated remotely restart their session is interrupted, that has begun to enter the server restart operation preparation stage, but after the restart Why The operation failed? There is only one reason - that is, a program or process prevents the restart operation from continuing, that is, the system runs some programs that cannot be automatically closed, and the restart cannot be completed successfully.

So how to solve this problem? We can think of the symptoms that we usually encounter when operating the computer. Many times when we restart the computer or turn off the computer, a "something can't be closed. Please press the forced close button or wait for a while and try again to close the operation." "This is the same principle as the problem encountered by the netizen above." The difference is that when the machine is operating, you can click the "force close" button to complete the restart operation. On the server, because the remote desktop program will end before these difficult processes, we can't click the "force close" button. I have done the operation. Knowing the root of the problem, we can solve it from two aspects.

(1) identify the troublemakers process:


First, we should operate in the server room rather than a remote connection to the server, and then perform a restart on the server console The operation, to see if there is a prompt message appears, if there is, according to the prompt to delete the corresponding program, only to delete the messy program can ensure that the remote restart server successfully completed.

(2) forcibly terminate the process:
But sometimes we find it impossible to close the program or process is key to the process server is running, or indispensable, so then you can not It is enough to delete the program corresponding to the process by the previous method, and replace it by forcibly closing the command.

have the windows 2003 server in a file called shutdown.exe, he is responsible for restarting the computer, log off the computer, turn off the computer work, he can through completion of the operation. The good news is that the command provides parameters that can be used to force a process that blocks the restart of the computer.

Step 1:
Enter the command line mode via Windows 2003 server "Start -> Run -> Enter CMD".

Step:
enter shutdown mode command line after the carriage return.



Third Step:
default parameters can not be achieved without any operation, the following brief shutdown command common parameters.

/? - Display help information

/l - Logout

/s - Turn off the computer

/r - Shut down and restart the computer

/a - Cancel the operation of abandoning the system shutdown.

/h - Sleep the local computer.

/t xxx——Set the timeout before closing to xxx seconds, without adding xxx to 30 seconds by default.

/f - Force the running application to close without warning the user in advance, this is the key to our article.

Step 4:
Execute "shutdown -r -f -t 1" (without quotes) command to complete our forced restart of the computer operation, encounter a process that cannot be automatically closed or The program will be forced to close. The -r parameter in the command is restarted, -f is the forced shutdown process and the program, and "-t 1" is set to 1 second when the shutdown is set.



Step five:
so that later after we connected to the server via Remote Desktop can shutdown -r -f -t 1 let it restart, even if Processes that fail to shut down are also forced to close.

Tip:

In addition, sometimes encounter some processes that cannot be closed, it is necessary to wait for a period of time to try to shut down again by the system itself, but the default waiting time is longer, in fact we can To greatly shorten this time, open the registry by "Start -> Run -> Enter regedit and press Enter" to expand HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Control, which has a value WaitToKillServiceTimeout, and its value data is " 20000" is changed to "0".



by such modifications, we wait after closing time can be greatly reduced, but this method is difficult for those who need to force shut off and the process is invalid.

Copyright © Windows knowledge All Rights Reserved