Windows 7 remote shutdown: Access denied(5)

Gottlieb Notschnabel picture Gottlieb Notschnabel · May 13, 2013 · Viewed 87.2k times · Source

I am trying to force a remote shutdown from my laptop to my PC:

machine> shutdown -m \\192.168.2.10 -s -f -t 0
192.168.2.10: Access denied(5)

I am in a WLAN/LAN environment:

  • Laptop is in WLAN with IP 192.168.2.100 (DHCP), Win 7 (64 bit)
  • PC is connected via LAN 192.168.8.10 (static), Win 7 (32 bit)
  • Router IP 192.168.2.1/Subnetmask 255.255.255.0

Access to PC is restricted by username and password.

What do I have to change about the command or about the systems configurations - whilst access restrictions have to remain as is?

Answer

jveazey picture jveazey · May 13, 2013

You can use the NET USE command to authenticate on the remote server and then use shutdown.exe

NET USE \\MyServer\IPC$ mypassword /USER:myuser

http://www.squidworks.net/2011/07/how-to-pass-a-username-and-password-to-windows-shutdown-exe-command/

This does not work with UAC enabled, unless the policy LocalAccountTokenFilterPolicy is enabled on the remote server.

When a user who is a member of the local administrators group on the target remote computer establishes a remote administrative connection by using the net use * \remotecomputer\Share$ command, for example, they will not connect as a full administrator. The user has no elevation potential on the remote computer, and the user cannot perform administrative tasks.