PHP implementation to disable remote computer _ PHP Tutorial

Source: Internet
Author: User
Disable remote computers in PHP. There are many ways to implement remote computers. if you disable a remote WINDOWS computer, extract a shutdown command to show that the syntax format of the Shutdown command is: shutdown [-I |-l |-there are many ways to implement remote computers. here we will explain how to extract a shutdown command to disable remote WINDOWS computers.

The syntax of the Shutdown command is as follows: shutdown [-I |-l |-s |-r |-a] [-f] [-m [\ ComputerName] [-t xx] [-c "message"] [-d [p]: xx: yy].

-I displays the graphic interface dialog box.

-L cancels the current user, which is the default setting.

-S to close the computer.

"-R" is disabled and then restarted.

-A abort and close.

-F forces the application to be closed.

"-M [\ ComputerName] specifies the computer to close.

-T xx sets the timer used for system shutdown to xx seconds. the default value is 20 seconds.

"-C" message "specifies the message that will be displayed in the" message "area in the" system off "window. it can contain a maximum of 127 characters and must contain messages in quotation marks.

"-D [p]: xx: yy" lists the cause code for system shutdown.

Except for "-l" and "ComputerName", other parameters are ignored. During the timeout period, only "-a" can be used ".

For example, if you enter "shutdown-s-m \ work1-t 60" to close the machine named work after 60 seconds, the machine must also have a Windows XP operating system. If you enter "shutdown-s-t 30", the system will automatically shut down after 30 seconds. "Shutdown-l" indicates logging out of the local user, which is not applicable to remote computers. Use shutdown-r to restart the local computer. "Shutdown-a" can cancel the Shutdown command that has been issued. To disable the local computer, you can use "shutdown-s ".

In PHP, system and exec can run the shutdown command. if the hardware and software configurations of the remote computer meet the following conditions, run the command: Grant the Guest user the permission to remotely shut down the computer. When a remote user connects to a local Windows XP system, the user is connected as a Guest, and the administrator permission is required for remote shutdown. Therefore, the user must be granted the permission for remote shutdown. Start the computer that requires remote shutdown. in the "run" dialog box, enter "gpedit. msc" to open the "Group Policy Editor ". Expand "computer configuration"> "Windows settings"> "security settings"> "local policy"> "user rights assignment ", in the window on the right, find the force shutdown from the remote system option. Double-click the project. in the displayed dialog box, click "add", enter the user name "guest" in the new dialog box, and click "OK ". Now the "guest" user is added to the "force shutdown from the remote system" attribute, and click "OK" to exit.


Code:

System (shutdown-s-m \ work1-t 60 );
?>

The syntax format of the Shutdown command is shutdown [-I |-l | -...

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.