Remote restart windows 7 remote desktop

When I connect to my Windows 7 desktop computer via Remote Desktop (MSTSC.exe), the options under the Start Menu are "Log Off" (the default), "Lock", and "Disconnect". How do I restart (or shutdown)?

The answer Marcus Adams gave also has a keyboard shortcut: Ctrl+Alt+End. You do have to be in full screen and/or have the RDP session set to Apply Windows key combinations on the remote computer. This effectively sends a Ctrl+Alt+Del to the remote computer (so it’s handy to know for other occasions/uses too). From there, as Marcus said, you can get to Restart, Shutdown, etc. from the little red power button icon in the lower right corner.

Alternatively, you can click once on the Desktop (or the Taskbar) of the remote computer, then press Alt+F4 and you get the old-fashioned pop-up with all the shutdown options in the drop down.

Update: as noted in the comments, Ctrl+Alt+End in Windows 10 only gives you the option to Disconnect. You can’t Restart or Shutdown from there. I also can’t find a Windows Security option in the Start Menu… But no worry, as mentioned the Alt+F4 method still works, and I use that exclusively now (I remote in for work every day, and also manage multiple machines at home).

  • Remove From My Forums
  • Question

  • Hello all:

     I’m remote to a windows 7,but i can not find the shutdown and restart button,I know i can use some command to do it,such as shutdown -s -t 0,Powershell:restart-computer,But i’m a IT PRO,i want my user can use button to do that,how to add «shutdown»
    «restart» button to start menu,GPO?how to modify it,i already modify the «force shutdown from remote»,but i also can’t find them from my start menu,Help!!

Answers

  • The official GUI way to shut down a PC over remote desktop is to press Ctrl+Alt+End, then select the Shut Down button there. The shutdown -s -t 0 command is more of a hack.

    • Marked as answer by

      Tuesday, May 14, 2013 5:04 AM

  • Hi,

    You can save the command as a batch file and put it on the Desktop or other locations.
    In addition, you can refer to the following link to Use the Remote Shutdown Tool to shut down and restart a computer.
    http://technet.microsoft.com/en-us/library/cc770416.aspx

    Hope the information helps.


    Tracy Cai
    TechNet Community Support

    • Marked as answer by
      tracycai
      Tuesday, May 14, 2013 5:04 AM

rdp-shutdown-000.jpgУдаленный доступ к рабочему столу по протоколу RDP широко используется для работы не только с серверами, но и с рабочими станциями, как для удаленной работы, так и в целях администрирования. Однако есть некоторые ограничения, в частности в среде клиентской ОС нельзя управлять параметрами питания, даже имея права локального администратора. В некоторых случаях это способно взывать затруднения, поэтому если вы до сих пор не знаете, как выключить или перезагрузить клиентскую версию ОС через RDP — эта статья для вас.

Научиться настраивать MikroTik с нуля или систематизировать уже имеющиеся знания можно на углубленном курсе по администрированию MikroTik. Автор курса, сертифицированный тренер MikroTik Дмитрий Скоромнов, лично проверяет лабораторные работы и контролирует прогресс каждого своего студента. В три раза больше информации, чем в вендорской программе MTCNA, более 20 часов практики и доступ навсегда.

В серверных системах семейства Windows локальный администратор, не говоря о доменном, имеет полный контроль над системой и не испытывает затруднений в управлении питанием даже подключившись через удаленный доступ.

rdp-shutdown-001.jpgВ клиентских ОС ситуация принципиально иная, даже локальный администратор не имеет возможности выключить или перезагрузить компьютер.

rdp-shutdown-002.jpgНесмотря на кажущуюся нелогичность, определенный смысл в таком поведении есть. Серверные ОС администрируют профессионалы (как минимум в теории), которые должны отдавать себе отчет о возможных последствиях своих действий. С другой стороны, удаленно выключив ПК так просто включить его уже не получится, в большинстве случаев потребуется физическое присутствие, поэтому решение убрать подобную функцию от простых пользователей выглядит вполне обоснованно. Администраторы, следуя этой логике, должны уметь управлять питанием и иными способами.

Но как показывает практика, умеют это не все. Ничего страшного в этом нет, как говорил мой школьный учитель: спросить — стыд минуты, не знать — стыд всей жизни.

Графическая оболочка

На самом деле «проблема» решается не просто, а очень просто. Выйдя на рабочий стол достаточно нажать Alt+F4 чтобы получить стандартный диалог завершения работы.

rdp-shutdown-003.jpgОднако у этого способа есть один существенный недостаток. Очень часто выключить или перезагрузить компьютер мешают некоторые приложения, например, несохраненный документ. Подобная картина, на наш взгляд, знакома каждому.

rdp-shutdown-004.jpgБеда в том, что этого экрана через RDP вы уже не увидите. Да и открытые приложения — это полбеды, хуже, когда систему не дает выключить или перезагрузить зависшее приложение. В этом случае придется искать иные методы.

Командная строка

Как обычно, если графические инструменты не помогают, на помощь администратору приходит командная строка. Для того, чтобы управлять питанием компьютера с ее помощью не надо обладать особыми знаниями, достаточно запомнить одну простую команду. Нажмите Win+R или Пуск — Выполнить и введите следующие команды:

shutdown -s -f -t 0

для выключения

shutdown -r -f -t 0

для перезагрузки.

rdp-shutdown-005.jpgРазберем ключи команды подробнее:

  • s — выключение компьютера
  • r — перезагрузка
  • f — принудительное завершение мешающих перезагрузке процессов
  • t — время, через которое завершение работы будет выполнено, указывается в секундах через пробел. Если данный параметр не используется команда будет выполнена через 60 секунд.

Утилита PsShutdown от Sysinternals

Если штатные возможности вас по какой-либо причине не устраивают, то можно воспользоваться альтернативой — утилитой PsShutdown от Sysinternals. Разместите скачанный файл в любом удобном месте, лучше всего в одном из указанных в переменной PATH, либо добавьте туда ее расположение, это позволить запускать ее по короткому имени, без указания пути. Синтаксис утилиты похож на синтаксис стандартной, но есть некоторые отличия, так для выключения выполните:

psshutdown -k -f -t 0

а для перезагрузки:

psshutdown -r -f -t 0

Поясним используемые ключи:

  • k — выключение системы
  • r — перезагрузка
  • f — принудительное завершение процессов
  • t — время выполнения команды

Если вместо ключа -k использовать для выключения ключ -s, то система завершит работу без выключения питания, старожилы должны хорошо помнить:

rdp-shutdown-006.jpgКроме того, данная утилита позволяет управлять питанием других ПК по сети. Если честно, то работать по сети умеет и штатная утилита shutdown, достаточно указать ключ:

-m \computer

Но есть один существенный недостаток — команда выполняется в контексте запустившего его пользователя, поэтому вы из дома не сможете выключить рабочий ПК, даже имея доступ в корпоративную сеть через VPN и имея учетные данные администратора сети.

PsShutdown данного недостатка лишена и позволяет указывать учетные данные для подключения к удаленному ПК, например:

psshutdown \computer -u username -p password -r -f -t 0

Данная команда выполнит перезагрузку удаленного ПК computer использовав для подключения имя username и пароль password. Следует помнить, что указанный вами пользователь должен иметь права доступа к административному ресурсу ADMIN$. В среде Active Directory этим правом обладает администратор домена, а вот в одноранговой сети могут возникнуть затруднения.

Если вы попробуете выключить удаленную систему даже с использованием учетных данных локального администратора, то скорее всего получите ошибку Отказано в доступе.

rdp-shutdown-007.jpgЭто свидетельствует о том, что данный пользователь не имеет доступа к ресурсу ADMIN$. Чтобы его включить нужно выполнить два условия: включить общий доступ к файлам и принтерам

rdp-shutdown-008.jpgА затем в ветвь реестра

HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionPoliciesSystem

добавить параметр типа DWORD с именем

LocalAccountTokenFilterPolicy

и установить его значение равным 1. После этого компьютер потребуется перезагрузить.

Попробуем снова выключить его удаленно.

rdp-shutdown-009.jpgКак видим в этот раз команда отработала успешно.

PowerShell

Использовать PowerShell для выключения или перезагрузки компьютера, это сродни стрельбы из пушки по воробьям, но в ряде случаев может оказаться полезным.

Для выключения используйте команду:

Stop-Computer -Force

А для перезагрузки:

Restart-Computer -Force

Ключ -Force в данном случае аналогичен ключу -f команды shutdown и предполагает принудительное завершение работы мешающих выключению приложений.

Также PowerShell можно использовать для управления питанием по сети, например, можно выключить удаленный ПК командой:

 Stop-Computer -ComputerName computer  -Credential username -Force

Где ключи:

  • ComputerName — имя удаленного компьютера, допускается перечисление нескольких имен через запятую
  • Credential — имя учетной записи для аутентификации в удаленной системе

При этом работа через PowerShell более безопасна, так как пароль не вводится открытым текстом и не остается в истории команд. Для аутентификации используются стандартные механизмы ОС.

rdp-shutdown-010.jpgКак видим, для управления питанием в ОС Windows доступны самые разнообразные инструменты — на любой вкус и цвет. При этом все они доступны внутри терминальной сессии, какой из них использовать — дело личного вкуса и предпочтений.

Научиться настраивать MikroTik с нуля или систематизировать уже имеющиеся знания можно на углубленном курсе по администрированию MikroTik. Автор курса, сертифицированный тренер MikroTik Дмитрий Скоромнов, лично проверяет лабораторные работы и контролирует прогресс каждого своего студента. В три раза больше информации, чем в вендорской программе MTCNA, более 20 часов практики и доступ навсегда.

How to block File Sharing for one or more IP Addresses in Windows

If you’re frequently using the Windows Remote Desktop feature (aka Terminal Services) during your daily activity, you most likely already know that  the «System Shutdown» and «System Reboot» options are missing from the GUI. As a matter of fact, these buttons have been intentionally removed to protect the remotely connected user from accidentally or unwillingly shutdown or reboot the machine, thus shutting out himself and without being able to operate with it anymore.

That said, if you know what you’re doing and you really need to remotely perform a system shutdown or reboot, you can use one of the following methods.

Method #1: Keyboard Shortcut

This is a neat & clean solution, fully manageable via GUI, which will most likely be appreciated by most keyboard shortcut fans.

  • Ensure that the focus is on the Desktop by simultaneously pressing Win + D
  • Press ALT + F4 to bring up the «Shut down Windows» popup window.
  • From such window, you’ll be able to choose between the following list of actions: Disconnect, Sign out, Shut down, and Restart. Just pick the one corresponding to what you need to do, and you’re done.

Shutdown and Restart a Windows PC from a Remote Desktop session - RDP

Method #2: Command Prompt

This option is slightly more complicated, however it might have sense whenever, for any reason, you are unable to use keyboard shortcuts in a decent way — for example if you are connecting via a mobile device using some not-so-great RDP native app.

  • From the START menu, go to All Programs > Accessories (on Windows 7) or just type «prompt» (Windows 8 / 8.1 and Windows 10).
  • Right-click on the Command Prompt icon, then left-click on Run as Administrator. Depending on the security settings on your machine, a warning popup might appear or not: if it does, just click OK to continue.
  • A black window will appear on the screen: in case you don’t know it already, this is the Command Prompt.
  • Click inside the window to make sure you have the focus in it, then type in one of the following commands:
    • To perform a machine shutdown:
      shutdown /s /t 0
    • To issue a machine reboot:
      shutdown /r /t 0

Shutdown and Restart a Windows PC from a Remote Desktop session - RDP

Conclusion

That’s it, at least for now: we hope this post can be useful for those who need to turn off or restart their machines remotely.

IMPORTANT: in case of shutdown, be wary that you won’t be able to to access the machine using the Remote Desktop software anymore, unless you have the possibility to restart it (eg via Magic Packet); if you issue a reboot, you should be able to access the system again after a few minutes (the actual boot time), provided that the RDP service has been properly configured to automatically start upon each boot (the default settings when you install it for the first time).

How do I force restart a PC remotely?

Enter your username on the machine or Microsoft Account ID followed by your password. At the command prompt, type shutdown -r -m MachineName -t -01 then hit Enter on your keyboard. The remote computer should automatically shut down or restart depending on the switches you choose.

How do I reboot my computer windows 7?

The quickest way to reboot Windows 7, Windows Vista, or Windows XP is through the Start menu:

  1. Open the Start menu from the taskbar.
  2. In Windows 7 and Vista, select the small arrow next to the right of the “Shut down” button. Windows 7 Shut Down Options. …
  3. Choose Restart.

11 сент. 2020 г.

How do I force restart Windows 7 from command line?

From an open command prompt window:

type shutdown, followed by the option you wish to execute. To shut down your computer, type shutdown /s. To restart your computer, type shutdown /r.

How do I send Ctrl Alt Del to remote desktop?

Method 2. On the Remote Desktop, select “Start“. Type “osk“, then open the “On Screen Keyboard“. Press “Ctrl” and “Alt” on the physical keyboard, then select “Del” on the osk window..

Can you remote desktop to a computer that is turned off?

Wake-on-LAN is enabled in the remote access software. What is Wake-on-LAN? … In combination with remote access software, it is a breeze to set up and use, to connect to your remote computer from anywhere even if it is powered off, in hibernation (Windows) or sleep (Mac) mode.

How do I restart an unresponsive server remotely?

Windows systems has a built in shutdown command that can be used to restart or shutdown local and remote computers. The command is shutdown. To use this command just open the windows command prompt and type shutdown. To view the full list of command options type shutdown /? in the CMD window.

How do I fix Windows 7 not booting up?

To do so, you need to run the bootrec utility:

  1. Insert the Windows Vista or Windows 7 install disc and restart the computer.
  2. Boot from the disc.
  3. Click Repair your computer.
  4. Select Command Prompt at the System Recovery Options screen.
  5. Type: bootrec /FixMbr.
  6. Press Enter.
  7. Type: bootrec /FixBoot.
  8. Press Enter.

How do I fix Windows 7 failed to boot?

On the System Recovery Options menu, select Startup Repair, and then follow the on-screen instructions. When it completes, restart your computer to see if it fixed the problem. When the startup repair process is done, you may restart your computer and check if Windows failed to start Windows 7 error disappears.

How can I repair my Windows 7?

Follow these steps:

  1. Restart your computer.
  2. Press F8 before the Windows 7 logo appears.
  3. At the Advanced Boot Options menu, select the Repair your computer option.
  4. Press Enter.
  5. System Recovery Options should now be available.

How do I force restart from command prompt?

To perform a Force Restart, type in Shutdown –r –f. To perform a Timed Force Restart, type in Shutdown –r –f –t 00.

How do I reboot in safe mode Windows 7?

Turn on the computer and immediately begin pressing the F8 key repeatedly. From the Windows Advanced Options Menu, use the arrow keys to select Safe Mode, and press ENTER. The computer will automatically exit Safe Mode when it is shut down.

How do I force a restart?

Hard Reboot

  1. Press and hold the power button on the front of the computer for approximately 5 seconds. The computer will shut off. No lights should be near the power button. If lights are still on, you can unplug the power cord to the computer tower.
  2. Wait 30 seconds.
  3. Push the power button to turn the computer on again.

30 мар. 2020 г.

How do I unfreeze my remote desktop?

CTRL+ALT+END: Reboots the remote computer. Press CTRL+ALT+END, then click on the Power icon seen at bottom-right. These are the choices you may see, in Windows 10.

What is the command for Ctrl Alt Delete?

Control-Alt-Delete (often abbreviated to Ctrl+Alt+Del, also known as the “three-finger salute” or “Security Keys”) is a computer keyboard command on IBM PC compatible computers, invoked by pressing the Delete key while holding the Control and Alt keys: Ctrl + Alt + Delete .

Is there an alternative to Ctrl Alt Delete?

You can try the “break” key, but in general if you are running windows and it won’t recognize CTRL-ALT-DEL with, say, 5–10 seconds, then part of the operating system in memory (the interrupt handler) has been corrupted, or possibly you’ve tickled a hardware bug.

There will be times as a Windows Administrator when you will need to reboot or shutdown a remote computer or server.

In this tutorial, I’ll show you two easy methods for rebooting and shutting down remote computers.

The first method uses a built in Windows command and the second method uses PowerShell.

Check it out.

Windows Remote Shutdown Command

Windows systems have a built in shutdown command that can be used to restart or shutdown local and remote computers.

The command is shutdown.

To use this command just open the windows command prompt and type shutdown.

To view the full list of command options type shutdown /? in the CMD window.

There are several command line switches, below I list the most useful options.

/s – Shutdown the computer

/r – restart computer

/m \computer – Specify the remote computer

/l – Log off

/t xxx – Set the time out period before shutdown to xxx seconds

/c “comment” – Message to display on the screen before restart or shutdown

Now let’s move on to some examples

Restart or Shutdown Examples with Command Line

In these examples, I’ll be on PC1 and will initiate a remote restart or shutdown on PC2.

I’ll be using the /r switch in these examples, you can change them to /s to shutdown instead of restart.

Example 1: Restart Remote Computer

By default, this will prompt the remote computer and give it about a minute before it restarts.

shutdown /r /m \pc2

The pop up below is what a Windows 10 system will display.

Example 2: Restart With a Custom Message

You may want to display a custom message to the logged on users, to do that just use the /c command.

shutdown /m \pc2  /c "The IT department has initiated a remote restart on your computer"

Below is the pop up on the remote computer with the custom message.

Example 3: Immediate Restart no Countdown

If you want to immediately restart with no countdown or message use this command.

shutdown /r /m \pc2 /t 0

If you want a longer countdown just specify the seconds /t 60

Example 4: Log user off the remote computer

If you just want to log a user off the remote computer use this command.

shutdown /l /m\pc2

Restart or Shutdown the Computer with Powershell

Here are a few examples of how you can restart or shutdown computers with PowerShell.

The downside to PowerShell is it doesn’t have as many options as the shutdown command. There is no option to prompt users with a custom message or provide a countdown.

Example 1: Use Powershell to restart a computer

This command will immediately restart a remote computer. The -Force option will force a restart even if a user is logged on.

Restart-Computer -ComputerName REMOTE_COMPUTER_NAME -Force

Example 2: Use PowerShell to shutdown a computer

This command will shutdown a remote computer. Use the -Force to force a shutdown even if a user is logged on.

Stop-Computer -ComputerName REMOTE_COMPUTER_NAME -Force

Example 3: Use PowerShell to restart a list of computers

This is handy if you have several computers to restart. Just list all the computers you want in a text file and add that to the PowerShell command.

restart-computer (get-content c:workcomputers.txt)

Example 4: Use PowerShell to shutdown down two computers

Stop-Computer -ComputerName "Server01", "Server02"

Want an easy way to check server uptime and last boot date on all computers? Then check out the tool below.

The AD Pro Toolkit includes 13 tools to simplify Active Directory and computer management. Download a free trial and try it for yourself.

We show you how to reboot or shutdown a remote computer using in-built and third party tools.

UPDATED: January 11, 2023

How to Shutdown or Reboot a Remote Computer

If you have multiple computers on your home or office network, you can remotely administer them regardless of their operating system

Remote computer administration refers to any method of controlling a computer from a remote location anywhere in the world. Remote administration among other things includes the ability to shut down or restart a computer. If you have two or more computers connected to your home or office network, or even outside your network, you can use one of them to shut down the others remotely. Windows, Linux, and Mac computers all support this feature.

If you are using Windows, you’ll need to pre-configure the remote computer to be able to support remote shut down. Once this is set up, you can easily perform the shutdown with a simple Terminal command from any computer. This article will show you various methods you can use to shut down or restart a remote computer.

Shutdown remote computers using PsExec command

PsExec is a utility from Microsoft that allows you to execute commands on a remote computer. For example, you can use PsExec to shut down and restart a remote computer, manage processes on the remote computer, and much more, without having to manually install client software—you only need to copy PsExec onto your executable path. However, the tool only works when the following criteria are met:

  • File and Printer Sharing is enabled on both the local and remote computer
  • Both computers belong to the same Workgroup or Domain network
  • You know the password to the administrator’s account on the remote computer

Before using PsExec to execute remote commands, you need to download and extract the files from PsTools on the computer that will be running the remote commands. Follow the steps below to complete the setup process:

  • Open the folder where the extracted files are located, and from the navigation bar at the top of the folder, erase what’s there and enter cmd. This will open Command Prompt in that folder so that you can run commands through PsExec.
  • With Command Prompt now open to the folder that contains PsExec.exe, you can start entering commands on the remote machine.
  • Enter the following commands to execute cmd on the target remote machine (using the IP address or computername): psexec \192.168.1.50 cmd
  • Once completed, you should be able to enter commands as if you were sitting in front of the remote computer. Now, you should be able to shut down or restart the remote computer using the following commands as the case may be:

shutdown /s Shut down the computer.

reboot /r     Reboot the computer.

Copy PsExec onto your executable path and launch Command Prompt

Figure 1.0 | Copy PsExec onto your executable path and launch Command Prompt

Shut down a remote computer using net use command

The net use command enables you to connect to, remove, and configure connections to shared resources such as mapped drives and network printers. You can also use it to shut down or reboot a remote computer. It does this using various parameters and switches. The command is available from the Command Prompt in Windows desktop (Windows 10/8/7) and server (server 2008/2016/2019) operating system.

To use the net use command to shut down or restart a computer over the network, you need to disable the User Account Control for remote executions in the registry by following the steps below:

  • First, open and run Command Prompt as administrator.
  • Type the following command to disable the User Account Control for remote executions and press the Enter key:

reg add HKLMSoftwareMicrosoftwindowsCurrentVersionPoliciessystem /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

Once completed, your device will be open to receive commands remotely from authenticated users. The syntax to shutdown a remote computer is as shown below:

shutdown /s /m \REMOTE-PC /t TIME /c “COMMENT” /f

  • /s is used to shutdown the computer.
  • /r is used to reboot the computer.
  • /m \computer is used to specify the target computer
  • /t is used to set the time-out period before shutdown
  • TIME represents the number of seconds to wait before beginning the shutdown process
  • /c is used to print comments to the computer screen before rebooting or shutting down
  • COMMENT means the custom dialog you want to send the user
  • /f is used to force running applications to close without forewarning users

Now, follow the steps below to shutdown a remote computer with the IP 192.168.1.50 using the above syntax:

  1. Open and run Command Prompt as administrator
  2. Type the following command to connect to the Windows built-in Inter-Process Communication share (IPC$) and anonymous user account and a null password, and press Enter: net use \192.168.1.50IPC$ “” /u: “”
  3. Confirm the account name located in the remote device and press Enter.
  4. Confirm the account password and press Enter.
  5. Type the following command to shut down, consisting of the remote computer, and press Enter:

shutdown /s /m \192.168.1.50 /t 120 /c “This PC will shut down in two minutes for maintenance.” /f

If no one is using the computer, you can use the command below to shut down the device immediately:

shutdown /s /m \192.168.1.50 /t 0 /f

Once these steps are completed, the remote host will power off according to the initiated commands.

Shutdown a remote computer using PowerShell

PowerShell is a cross-platform task automation solution from Microsoft, consisting of a command-line shell, a scripting language, and a configuration management framework. PowerShell runs on Windows, Linux, and Mac. PowerShell can be used to perform the shutdown of remote computers in bulk without enabling remote shutdown capability.

The Stop-Computer and Restart-Computer cmdlet are the PowerShell commands to shutdown and restart local and remote computers. The Stop-Computer cmdlet has the -ComputerName switch, through which you can specify a list of systems that require shutdown. Some of the notable parameters for the Stop-Computer command are as follows:

  • ComputerName: Specifies the computers to shut down. The default is the local computer. The computer name can be the NETBIOS name, IP address, or FQDN (Fully Qualified Domain Name) of one or more computers in a comma-separated list. To specify the local computer, type the computer name or localhost.
  • Confirm: Prompts you for confirmation before running the cmdlet.
  • Credential: Specifies a user account that has permission to do this action. The default is the current user. The certificate can be a user name, such as user001 or domain01user001, or a PSCredential object generated by the Get-Credential cmdlet. If you enter a user name, you’ll be prompted to enter the password.
  • Force: Forces an immediate shut down of the computer.
  • WsmanAuthentication: Specifies the mechanism used to authenticate the user credentials when the cmdlet uses the WSMan protocol. The default value is Default. The acceptable values for this parameter are: Basic, CredSSP, Default, Digest, Kerberos, and Negotiate.

Shutdown remote computers: Here’s the syntax to shutdown multiple remote computers using PowerShell cmdlet:

Stop-Computer -ComputerName 192.168.1.50, 192.168.1.51, 192.168.1.52

If someone is currently working on the remote computers, you will get an error. To solve this problem, you can add the -Force key, which will do a forced shutdown as shown below:

Stop-Computer -ComputerName 192.168.1.50, 192.168.1.51, 192.168.1.52 -Force

Shutdown using specified authentication: You may want to shut down a remote computer using specified authentication. This is where the WsmanAuthentication parameter comes into play. In the example below, the WsmanAuthentication parameter specifies using Kerberos to establish a remote connection.

Stop-Computer -ComputerName 192.168.1.50 -WsmanAuthentication Kerberos

Shutdown on behalf of a specific account: If you need to perform a shutdown on behalf of a particular account, then you can use the -Credential switch as shown below, which requires the domain name (domain01), the username (user001), and password when prompted:

Stop-Computer -ComputerName 192.168.1.50 -Credential domain01user001 -Force

Shutdown multiple computers in a domain: A situation may arise where you are required to shutdown multiple computers in a domain. The Stop-Computer command can easily cope with this task, but first, you need to create a text file containing a list of computers (in a single column) that need to be shut down, and then execute the command as shown below:

$b = Get-Content -Path C:computers.txt

$c = Get-Credential -Credential Domain01Admin01

Stop-Computer -ComputerName $b -Force -Credential $c

  • Get-Content uses the Path parameter to get a file in the current directory with the list of domain computers. The objects are stored in the $b variable.
  • Get-Credential uses the Credential parameter to specify the credentials of a domain administrator. The certificates are stored in the $c variable.
  • Stop-Computer shuts down the computers specified with the ComputerName parameter’s list of computers in the $b variable. Next, the Force parameter forces an immediate shutdown. Finally, the Credential parameter submits the credentials saved in the $c variable.

Shutdown as a background job: There may be situations where you wish to shutdown remote computers as a background job. In that case, the background operator & can be used to run the Stop-Computer command as a background job as shown below:

$b = Stop-Computer -ComputerName 192.168.1.50, 192.168.1.51  &

$results = $b | Receive-Job

$results

  • The job objects are stored in the $b variable
  • The job objects in the $b variable are sent down the pipeline to Receive-Job, which gets the job results
  • The objects are stored in the $results variable
  • The $results variable displays the job information in the PowerShell console

Shutdown a remote computer using GUI

This method provides a GUI that makes sending the shutdown command to a remote computer across the network more accessible. This is where the shutdowni command comes into play. This command brings up a graphical dialog that lets you select the remote computer or enter its name or IP address using the Add button. You can then specify whether you want to shut down or restart, including an option to add a comment.

Before you can execute this command, you first need to configure the remote computer to allow remote command executions using the following steps:

  • First, open and run Command Prompt as administrator.
  • Type the following command to disable the User Account Control for remote executions and press the Enter key:

reg add HKLMSoftwareMicrosoftwindowsCurrentVersionPoliciessystem /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

Once completed, you can then use the shutdowni command to shut down or restart multiple remote computers as the case may, using the steps below:

  1. Press Windows key + R on the keyboard to open the Run dialog
  2. Type shutdown /i command and click the OK button.
  3. Click the Add button.
  4. Enter the computer name or IP address of the remote computer.
  5. Click the OK button.
  6. (Optional) Repeat steps No. 4, 5, and 6 to add more computers to the list.
  7. Use the “What do you want these computers to do” option to select Shutdown, Restart, or Annotate Unexpected Shutdown.
  8. Check the “Warn user of the action” option to alert the user.
  9. Use the display warning option to specify how long the warning should display on the screen in seconds.
  10. Under the “Shutdown Event Tracker” section, use the Option drop-down menu and select why you are shutting down the computers.
  11. Check the “Planned” option if you want to register the action as planned. Otherwise, the action will register as “Unplanned.”
  12. In the “Comments” section, type the message you want the user to see—for example, “The PC will shut down in a minute for maintenance.”
  13. Click the OK button

Once the above steps are completed, the computers in the list will shut down according to your configuration and message.

Remote Shutdown Dialog box

Figure 2.0 | Screenshot showing Remote Shutdown Dialog box

Shutdown a remote computers using RDP

Remote Desktop Protocol (RDP) is a proprietary protocol developed by Microsoft which provides a user with a graphical interface to connect to another computer over a network connection. To initiate an RDP connection, an RDP client and server software are required at the local and remote computers, respectively. Fortunately, all of these come pre-installed on Windows machines. RDP clients are also available for most versions of macOS, Linux,  Android, and iOS. An open-source version is also available.

RDP saves you the headache of configuring and using the command line approach to shutting down and restarting remote computers. However, you may be required to configure port forwarding on your router if the remote computer is outside your network. Follow the steps below to shutdown a remote computer using RDP:

  • Type ‘RDP’ in the Windows search bar to locate the RDP app.
  • Enter the required login credentials when prompted to proceed further.
  • When the connection is established, you can then use your mouse to shut down or reboot your computer, as the case may be.

RDP interface box

Figure 3.0 | Screenshot showing RDP interface box

Shutdown a remote computers using third-party tools

Apart from the built-in shutdown commands and other embedded tools that can be used to shutdown/restart a local or remote computer, there are lots of free and commercial third-party remote administration tools out there that can equally do the job, if not better. In addition, third-party tools are much simpler to configure and use than most built-in tools.

Other systems to try include TeamViewer, TightVNC, LogMeIn, PuTTY, Symantec pcAnywhere, ManageEngine Shutdown / Restart Tool, and a host of others including remote access VPN applications. The only downside is that some third-party tools require their software installed on both local and remote computers.

ManageEngine Free Shutdown / Restart Tool

ManageEngine provides a Free Shutdown / Restart Tool that is part of a GUI system for managing Windows.

ManageEngine Free Shutdown - Restart Tool

To use this tool, follow these steps:

  1. Download the Free Windows Admin Tools.
  2. Click on the downloaded file to run the installer. This will add a launch icon to your desktop.
  3. Double-click on the Windows Admin Tools icon to run the interface.
  4. Click on Domain Settings in the left-hand panel and click on Add Domain in the main panel.
  5. Enter AD Domain Controller Admin credentials in the popup screen and click on OK.
  6. Click on the Manage Computers tab and select a computer from the first column.
  7. Click on Shutdown / Restart in the second column.
  8. In the third column of the screen choose Shutdown Now or Restart Now from the Select an option drop-down list.

Click on Execute to perform the action.

Conclusion 

We have discussed various methods you can use to shut down or restart a remote computer. While remote computer administration, including the ability to initiate a shutdown or restart, has many legal uses and offers many benefits, there are also security implications.

Cybercriminals may be able to take advantage of the configurations and settings that allow remote administration, as well as existing loopholes to gain remote access to your computer and carry out malicious activities. Therefore, you must adhere to secure remote access practices and ensure that appropriate security measures are in place to prevent security breaches.

Shutdown or reboot a remote computer FAQs

How do I send Ctrl Alt Del in Remote Desktop?

Pressing the «CTRL», «ALT» and «END» keys together will bring up the Windows Security Options screen from which you can shut down or reboot the computer. This works also within a Remote Desktop session. If you pressed these three keys while in a connection window, the shutdown options you get will apply to the remote computer and not your own.

How do you restart a computer by IP address?

You can shut down a remote computer over the network if you know its IP address. At the Windows Command Prompt, enter shutdown /m \[IP Address] but enter the address of the computer instead of [IP Address]. There are a number of other options that you can add to this command, such as displaying a message on the remote computer or delaying the shutdown. Just enter shutdown at the Command Prompt to see the full list of options.

What is the reboot command?

You can reboot a remote computer from the Windows Command Prompt, using the shutdown utility. Enter shutdown /r /m \[IP Address] at the command line but put the IP address of the computer that you want to shut down instead of [IP Address].

Если у вас в офисе или дома установлено несколько компьютеров, а также в разных комнатах, может быть сложно перезагрузить каждый из них. Вместо физического перезапуска компьютеров вы можете перезапустить удаленные компьютеры с помощью командной строки Windows.

Однако, чтобы это работало, вам необходимо убедиться, что удаленный компьютер, который вы перезагружаете, находится в той же сети, что и тот, который вы используете. Кроме того, вам потребуются учетные данные администратора или имя пользователя и пароль.

Вам также необходимо включить удаленное отключение на хост-компьютере, чтобы это работало. Если вы не хотите использовать CMD, вы можете использовать одно из лучших программ удаленной перезагрузки для управления Windows 10/11.

Использование команды завершения работы Windows для перезагрузки удаленного компьютера

ОС Windows поставляется с командой выключения, которую можно использовать для перезагрузки удаленного компьютера с помощью CMD. Его могут использовать пользователи Windows 11, 10, 8 и даже 7. Эта команда отключена.

Эта команда предоставляет пользователям несколько вариантов использования при перезагрузке или выключении компьютеров. Некоторые из наиболее распространенных вариантов включают в себя;

  • /r — используется для перезагрузки компьютера.
  • /s — используется при выключении компьютера.
  • /m \computer — используется для указания перезапуска или выключения удаленного компьютера.
  • /l — используется для выхода из системы.
  • /t xx — используется при установке времени ожидания перед перезапуском или выключением на xx секунд.
  • /c «комментарий» — используется, когда вы хотите отобразить определенное сообщение на экране перед перезагрузкой или выключением.

Как перезагрузить удаленный компьютер с помощью CMD?

1. Используйте команду выключения

  • Нажмите кнопку «Пуск» в левом нижнем углу в Windows 10 или предыдущих версиях ОС Windows. Однако кнопка «Пуск» находится в центре панели задач в Windows 11.
  • Введите cmd или командную строку в поле поиска.
  • Щелкните правой кнопкой мыши командную строку, чтобы открыть меню справа от значка CMD.

  • Выберите «Запуск от имени администратора», чтобы запустить командную строку с правами администратора. Однако вам необходимо войти в систему как администратор, чтобы убедиться, что доступ к командной строке не запрещен.
  • Введите следующую команду и замените имя компьютера на имя ПК, который вы хотите перезагрузить:
    shutdown /m \computername /r

  • Введите /f через один пробел после /r, если вы хотите закрыть все программы перед перезагрузкой. Однако уведомите пользователей, чтобы они сохранили свою работу.
  • Добавьте /c после /f, затем введите сообщение в кавычках, чтобы отправить сообщение на удаленный компьютер перед перезапуском. Ваша команда теперь будет выглядеть так
    shutdown /m \computername /r /f /c “This computer is about to restart"

  • Введите /t xx, где xx представляет собой количество секунд, в течение которых удаленный компьютер должен перезагрузиться. Таким образом, ваша новая команда будет
    shutdown /m \computername /r /f /c “This computer is about to restart” /t 30
  • Нажмите Ввод.

2. Диалоговое окно удаленного выключения

  • Выполните первые четыре шага выше, чтобы запустить командную строку от имени администратора.
  • Введите следующую команду и нажмите Enter
    shutdown -i

  • Вы получите диалоговое окно удаленного завершения работы. Нажмите «Добавить» в правой части диалогового окна «Удаленное завершение работы».

  • Введите IP-адрес компьютера, который вы хотите перезагрузить, и нажмите кнопку OK. Это позволяет вам перезагружать удаленный компьютер, используя его IP-адрес.

  • Выберите, что вы хотите, чтобы удаленный компьютер делал. В этом случае выберите «Перезагрузить».
  • Установите флажок Предупреждать пользователей о действии, чтобы установить таймер для перезагрузки компьютера. Однако это необязательно. 
  • Введите количество секунд, через которое компьютер должен перезагрузиться.

  • Установите флажок Запланировано, чтобы создать средство отслеживания событий для удаленного перезапуска. Опять же, это необязательно.
  • Выберите причину перезагрузки из раскрывающегося списка и введите комментарий, который будет отображаться на компьютере перед перезагрузкой.
  • Нажмите кнопку ОК.

3. Windows PowerShell

  • Нажмите кнопку «Пуск» и введите Powershell.  
  • Щелкните правой кнопкой мыши Windows Powershell и выберите «Запуск от имени администратора».

  • Выполните следующую команду, чтобы перезапустить удаленный компьютер с помощью Powershell, даже если он используется.
    Restart-Computer -ComputerName REMOTE_COMPUTER_NAME -Force
  • Замените REMOTE_COMPUTER_NAME именем компьютера для перезагрузки и нажмите клавишу ввода.

Три рассмотренных выше варианта помогут вам легко перезагрузить удаленный компьютер с помощью CMD без физического доступа к компьютеру. Однако перед запуском процесса убедитесь, что вы сохранили всю работу. Если вы этого не сделаете, вы можете потерять несохраненную работу.


Записки IT специалиста

Технический блог специалистов ООО»Интерфейс»

  • Главная
  • Админу на заметку — 17. Как выключить или перезагрузить компьютер через RDP

Админу на заметку — 17. Как выключить или перезагрузить компьютер через RDP

Удаленный доступ к рабочему столу по протоколу RDP широко используется для работы не только с серверами, но и с рабочими станциями, как для удаленной работы, так и в целях администрирования. Однако есть некоторые ограничения, в частности в среде клиентской ОС нельзя управлять параметрами питания, даже имея права локального администратора. В некоторых случаях это способно взывать затруднения, поэтому если вы до сих пор не знаете, как выключить или перезагрузить клиентскую версию ОС через RDP — эта статья для вас.

В серверных системах семейства Windows локальный администратор, не говоря о доменном, имеет полный контроль над системой и не испытывает затруднений в управлении питанием даже подключившись через удаленный доступ.

В клиентских ОС ситуация принципиально иная, даже локальный администратор не имеет возможности выключить или перезагрузить компьютер.

Несмотря на кажущуюся нелогичность, определенный смысл в таком поведении есть. Серверные ОС администрируют профессионалы (как минимум в теории), которые должны отдавать себе отчет о возможных последствиях своих действий. С другой стороны, удаленно выключив ПК так просто включить его уже не получится, в большинстве случаев потребуется физическое присутствие, поэтому решение убрать подобную функцию от простых пользователей выглядит вполне обоснованно. Администраторы, следуя этой логике, должны уметь управлять питанием и иными способами.

Но как показывает практика, умеют это не все. Ничего страшного в этом нет, как говорил мой школьный учитель: спросить — стыд минуты, не знать — стыд всей жизни.

Графическая оболочка

На самом деле «проблема» решается не просто, а очень просто. Выйдя на рабочий стол достаточно нажать Alt+F4 чтобы получить стандартный диалог завершения работы.

Однако у этого способа есть один существенный недостаток. Очень часто выключить или перезагрузить компьютер мешают некоторые приложения, например, несохраненный документ. Подобная картина, на наш взгляд, знакома каждому.

Беда в том, что этого экрана через RDP вы уже не увидите. Да и открытые приложения — это полбеды, хуже, когда систему не дает выключить или перезагрузить зависшее приложение. В этом случае придется искать иные методы.

Командная строка

Как обычно, если графические инструменты не помогают, на помощь администратору приходит командная строка. Для того, чтобы управлять питанием компьютера с ее помощью не надо обладать особыми знаниями, достаточно запомнить одну простую команду. Нажмите Win+R или Пуск — Выполнить и введите следующие команды:

Разберем ключи команды подробнее:

  • s — выключение компьютера
  • r — перезагрузка
  • f — принудительное завершение мешающих перезагрузке процессов
  • t — время, через которое завершение работы будет выполнено, указывается в секундах через пробел. Если данный параметр не используется команда будет выполнена через 60 секунд.

Утилита PsShutdown от Sysinternals

Если штатные возможности вас по какой-либо причине не устраивают, то можно воспользоваться альтернативой — утилитой PsShutdown от Sysinternals. Разместите скачанный файл в любом удобном месте, лучше всего в одном из указанных в переменной PATH, либо добавьте туда ее расположение, это позволить запускать ее по короткому имени, без указания пути. Синтаксис утилиты похож на синтаксис стандартной, но есть некоторые отличия, так для выключения выполните:

а для перезагрузки:

Поясним используемые ключи:

  • k — выключение системы
  • r — перезагрузка
  • f — принудительное завершение процессов
  • t — время выполнения команды

Если вместо ключа -k использовать для выключения ключ -s, то система завершит работу без выключения питания, старожилы должны хорошо помнить:

Кроме того, данная утилита позволяет управлять питанием других ПК по сети. Если честно, то работать по сети умеет и штатная утилита shutdown, достаточно указать ключ:

Но есть один существенный недостаток — команда выполняется в контексте запустившего его пользователя, поэтому вы из дома не сможете выключить рабочий ПК, даже имея доступ в корпоративную сеть через VPN и имея учетные данные администратора сети.

PsShutdown данного недостатка лишена и позволяет указывать учетные данные для подключения к удаленному ПК, например:

Данная команда выполнит перезагрузку удаленного ПК computer использовав для подключения имя username и пароль password. Следует помнить, что указанный вами пользователь должен иметь права доступа к административному ресурсу ADMIN$. В среде Active Directory этим правом обладает администратор домена, а вот в одноранговой сети могут возникнуть затруднения.

Если вы попробуете выключить удаленную систему даже с использованием учетных данных локального администратора, то скорее всего получите ошибку Отказано в доступе.

Это свидетельствует о том, что данный пользователь не имеет доступа к ресурсу ADMIN$. Чтобы его включить нужно выполнить два условия: включить общий доступ к файлам и принтерам

А затем в ветвь реестра

добавить параметр типа DWORD с именем

и установить его значение равным 1. После этого компьютер потребуется перезагрузить.

Попробуем снова выключить его удаленно.

Как видим в этот раз команда отработала успешно.

PowerShell

Использовать PowerShell для выключения или перезагрузки компьютера, это сродни стрельбы из пушки по воробьям, но в ряде случаев может оказаться полезным.

Для выключения используйте команду:

А для перезагрузки:

Ключ -Force в данном случае аналогичен ключу -f команды shutdown и предполагает принудительное завершение работы мешающих выключению приложений.

Также PowerShell можно использовать для управления питанием по сети, например, можно выключить удаленный ПК командой:

  • ComputerName — имя удаленного компьютера, допускается перечисление нескольких имен через запятую
  • Credential — имя учетной записи для аутентификации в удаленной системе

При этом работа через PowerShell более безопасна, так как пароль не вводится открытым текстом и не остается в истории команд. Для аутентификации используются стандартные механизмы ОС.

Как видим, для управления питанием в ОС Windows доступны самые разнообразные инструменты — на любой вкус и цвет. При этом все они доступны внутри терминальной сессии, какой из них использовать — дело личного вкуса и предпочтений.

Источник

Windows 7 remote desktop restart

The following forum(s) have migrated to Microsoft Q&A: All English Windows 7 IT Pro forums!
Visit Microsoft Q&A to post new questions.

Answered by:

Question

I’m remote to a windows 7,but i can not find the shutdown and restart button,I know i can use some command to do it,such as shutdown -s -t 0,Powershell:restart-computer,But i’m a IT PRO,i want my user can use button to do that,how to add «shutdown» «restart» button to start menu,GPO?how to modify it,i already modify the «force shutdown from remote»,but i also can’t find them from my start menu,Help!!

Answers

You can save the command as a batch file and put it on the Desktop or other locations.
In addition, you can refer to the following link to Use the Remote Shutdown Tool to shut down and restart a computer.
http://technet.microsoft.com/en-us/library/cc770416.aspx

Hope the information helps.

Tracy Cai
TechNet Community Support

All replies

You can save the command as a batch file and put it on the Desktop or other locations.
In addition, you can refer to the following link to Use the Remote Shutdown Tool to shut down and restart a computer.
http://technet.microsoft.com/en-us/library/cc770416.aspx

Hope the information helps.

Tracy Cai
TechNet Community Support

an «IT PRO» should know how to shut down Windows 7 remotely.

Click the power off button on the lower right.

a GUI will pop up but I am not sure how man seconds you can place in it. I tried the other night for a remote server to reboot in a few hours and couldn’t add 10000 seconds.

Create a batch file to bring up the GUI for your users and they should be good.

No need to be a jerk about it.

I would have used another word instead of jerk.

By the way, I’ve been an IT professional since before DOS, and I was a bit flummoxed by this too. Why MS decided not to put Shut Down on the Start Menu for users who have the shutdown rights, is a mystery to me. That’s where most of us will be looking for it, since that’s where we see it on our servers and desktops. I guess it’s either security by obfuscation or change for the sake of change.

Thank you Jose’! This is a perfect and easy solution!

It works from any computer, including Mac, as I have to remote in to a PC via a Mac. And while there is most likely a key or key combination to the «End» part of Ctrl+Alt+End for a Mac, most of us need to simple solutions that work, no matter what.

Just used the ‘Windows Security’, which is in the start menu apparently by default, to restart work computer. Worked like a charm! 100 Points.

If you click on the Start Menu button, one of the options on the right hand column of the Start Menu (when using RDP) is ‘Windows Security.’ If you click that, you will be presented with the screen you normally see when you hit Ctrl-Alt-Del. On the lower right, there should be a red button which will allow you to shutdown the computer.

Thank you so so so much. That should be the number 1 solution, not those lame comments.

Источник

Понравилась статья? Поделить с друзьями:
  • Remote ndis based internet sharing device что это как исправить windows
  • Remote mouse скачать на компьютер windows 10 на русском бесплатно
  • Remote manipulator system как удалить windows 10
  • Remote forkplayer для компьютера скачать windows 10
  • Remote fingerprint unlock скачать для windows 10