none
Remote shutdown Access Denied (5) RRS feed

  • Question

  • I have a computer that I want to shutdown remotely via command line (the shutdown -i), and if I have "password enable sharing" turned on I get access denied(5) but if that is turned off it works fine.

    How can I get this working again?

    I have read that I may need to create a user account with the same username and password of the account on this computer I wish to shutdown, but I have tried this and it does not work, plus having a extra account on either computer is kind of annoying, isn't there a way I can do it without having the same user account on my two PCs? Maybe like just using the username and password of the remote computer directly without actually having that account created on my PC?

    Sunday, October 14, 2012 1:37 AM

Answers

  • As Falcon said you need sufficient Local Privileges.

    You should create a user and make it a member of the Local Administrators Group on the Machine you want to shut down. The credentials should be identical the ones you are logged in with. Then from CMD you can try a SHUTDOWN -S (for shutdown) -m (for remote computer) \\ComputerName -t (to specify time to wait) 0

    If that doesn't work, try creating credentials on your PC that are the same as those used by the Administrator account on the other PC. From CMD you can type "runas /U:UserNameGoesHere CMD" and enter the password when prompted. Then try the command from the newly presented CMD Box.

    Sunday, October 14, 2012 8:09 AM
  • Hello,

    You can alternatively add your matching credentials to the server or computer you are trying to shut down remotely and make sure that the user has sufficient local privileges to perform a shutdown. I checked the shutdown switches but I could not find a switch that lets you enter alternate credentials for the shutdown.


    Miguel Fra | Falcon IT Services, Miami, FL
    www.falconitservices.com | www.falconits.com | Blog


    Sunday, October 14, 2012 3:08 AM

All replies

  • Hello,

    You can alternatively add your matching credentials to the server or computer you are trying to shut down remotely and make sure that the user has sufficient local privileges to perform a shutdown. I checked the shutdown switches but I could not find a switch that lets you enter alternate credentials for the shutdown.


    Miguel Fra | Falcon IT Services, Miami, FL
    www.falconitservices.com | www.falconits.com | Blog


    Sunday, October 14, 2012 3:08 AM
  • As Falcon said you need sufficient Local Privileges.

    You should create a user and make it a member of the Local Administrators Group on the Machine you want to shut down. The credentials should be identical the ones you are logged in with. Then from CMD you can try a SHUTDOWN -S (for shutdown) -m (for remote computer) \\ComputerName -t (to specify time to wait) 0

    If that doesn't work, try creating credentials on your PC that are the same as those used by the Administrator account on the other PC. From CMD you can type "runas /U:UserNameGoesHere CMD" and enter the password when prompted. Then try the command from the newly presented CMD Box.

    Sunday, October 14, 2012 8:09 AM
  • I am using this solution on a home Workgroup network.  Solution works for shutdown.exe and psshutdown.exe   It works for Windows 8 and should work for Windows 7.

    The problem is access is denied when attempting a remote shutdown using the interactive mode or the following command:

    shutdown.exe /s /m \\COMPUTERNAME /t 00

    Result:

    COMPUTERNAME: Access is denied.(5)

    CHANGE THE FOLLOWING SETTINGS ON THE REMOTE COMPUTER:

    Control Panel, Network and Sharing Center, Change Advanced Sharing settings

       "Private" enable "Turn on File and Printer sharing"


    Add Registry Key

    RUN regedt32.exe

    Goto:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

    Right click and add new DWORD

    "LocalAccountTokenFilterPolicy"=dword:00000001


    When user name and password are not the same on both computers change the following on the remote computer:

    Change Local Security Policy

    RUN secpol.msc

    Local Security Policy, Security Settings, Local Policies, User Rights Assignment

    Add "Everyone" to "Force shutdown from a remote system"


    Texas

    • Proposed as answer by rhl2000 Friday, October 17, 2014 7:07 AM
    Thursday, August 22, 2013 8:24 AM
  • Thanks TxRedCat.  Your solution worked for me, on a pair of computers where I had the same (administrator-level) account on both but nothing else had worked so far.

    Friday, October 17, 2014 7:09 AM
  • secpol.rsc is not available with Win 8.1 Home. Is there a registry solution for this setting?

    Thanks for the rest, Texas.


    • Edited by Gulliveig Tuesday, February 10, 2015 8:36 AM
    Tuesday, February 10, 2015 8:32 AM
  • Gulliveig,

    You should be able to find NTRIGHTS.EXE via a Google search (be sure to get it from a reputable source).

    From a command-line, run:

    NTRIGHTS.EXE -m \\localhost -u Everyone +r SeRemoteShutdownPrivilege

    Tuesday, March 10, 2015 8:41 PM
  • works, thanks
    Monday, April 4, 2016 10:19 AM
  • Nothing worked. I tried on both computers and did exactly what you said. Please help or send me a video tutorial I am seriously frustrated with my dumb computers ;_;
    Wednesday, May 11, 2016 1:16 AM
  • If your using shutdown.exe /s /f /m \\pc-name /t 0 on a windows xp machine. Uncheck the simple file sharing.

    Tools > Folder Options > View Tab > Use simple file sharing (recommended) at the very bottom.

    I do not believe that XP home edition has the ability to undo simple file sharing.

    Thursday, June 2, 2016 12:57 AM
  • I tried to add a new DWORD, but it said Error writing to the registry
    Sunday, August 13, 2017 12:59 AM