How-to : Pass a username and password to Windows shutdown.exe command.

Here was my scenario I found myself in not to long ago. I have an Active Directory domain with a server outside of the domain in it’s own workgroup. It used different credentials for the administrator account then what the domain uses. One day it stopped responding to RDP and several control programs we have on it so we needed to do a reboot.

No problems right? just type in the command below:

shutdown /r /t 3 /m \\ServerName

 

Not so right, right off the bat we get  ServerName: Access is denied.(5)

That’s right we do not have permissions “Yet”… But how do we send permissions to shutdown.exe ? If you do a shutdown /? you will find no switches for username and password but there is a way around this.

We will connect to the servers IPC$ and authenticate then we will run our command. Here is what you do:

First lets make a connection and authenticate by running the following cmd:

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

 

If successful then we are now ready to run the shutdown cmd in the same window:

shutdown /r /t 3 /m \\ServerName

Wait a few seconds and and you should get back your prompt which tells you the command was sent successfully. You now have authenticated and sent the shutdown cmd to a remote server using different permissions.

I hope this helps someone out there

Enjoy

Cubert

42 thoughts on “How-to : Pass a username and password to Windows shutdown.exe command.”

  1. Wow, didn’t even know this was possible! Will save me a lot of trouble from now on!

  2. Awesome, nice and easy, wanted to joke around with someone in my office today. I was right behind her when she read the message. She was like wth? I lol’d….luckily my wife has a sence of humor.. 😛

  3. The only thing is that it did not take server name, I was getting error 52.

    Worked when I used IP instead.

  4. Quote: “The only thing is that it did not take server name, I was getting error 52.
    Worked when I used IP instead.”

    Then you have a DNS issue. NET or SHUTDOWN have nothing to do with that.

  5. It’s working to connect an equipment NT from my Windows XP. How to make the same connection to the same equipment NT, from my Windows 7 ?

  6. tnx
    But it return following error:

    System error 53 has occurred.
    The network path was not found.

  7. C:\Users\scotts>net use \\kyras_vaio\IPC$ ****** /USER:scotts
    The command completed successfully.

    C:\Users\scotts>shutdown /s /t 3 /m \\kyras_vaio
    kyras_vaio: Access is denied.(5)

    same results with both /r and /s.
    Target is an XP Home SP3 box

  8. Jim, what do you enter if you login to account with no password? Nothing! So try the same approach 😉

  9. Thanks. Had to “allow” File and Printer sharing through firewall in remote PC before it actually worked. Your tip offered a breakthrough.

  10. It appears that passing credentials through “net use” does not influence Explorer in Windows 7 any more. Even after successful “net use” on ipc$ or particular x$ drive Explorer asks for credentials when entering the address for the same machine.

    Do you have any idea how to find a solution to that problem?

  11. C:\Users\sjamon>shutdown /r /t 3 /m \\PC-2248
    PC-2248: Access is denied.(5)

    C:\Users\sjamon>shutdown /r /t 3 /m \\PC-2248
    PC-2248: Access is denied.(5)

    C:\Users\sjamon>NET USE \\pc-2248\IPC$ /USER:Roywinn
    Local name
    Remote name \\pc-2248\IPC$
    Resource type IPC
    Status OK
    # Opens 0
    # Connections 1
    The command completed successfully.

    C:\Users\sjamon>shutdown /r /t 3 /m \\pc-2248
    pc-2248: Access is denied.(5)

  12. What if the target pc has no password ? And I am a bit unsure about my pc’s name: is it RADU-PC or just RADU, and is the name case sensitive, do I have to write it as Radu-PC.

  13. need help
    everthing was right.
    command completed succesfully
    BUT IT STILL SHOWS ACCESS DENIED (5)

  14. Well I know we had a bump in the past with the hp 1020 but This I time I need to shutdown a Non Domain PC remotely and you guys helped.

    Thanks

  15. Excellent tip! I hate powering down a server just by holding down the power button. Something happened to the video, but this let me restate gracefully!

  16. Enter the password after the username, ie

    net use \\serverip\ipc$ /user:USERNAME PASSWORD

    or if it’s on a different domain, do the following:

    net use \\serverip\ipc$ /user:domain\USERNAME PASSWORD

    Followed by shutdown /r /t 3 /m \\SERVERIP

  17. If you get an access denied, try running the command from an elevated command prompt (Run as Administrator)

  18. Thanks a ton!!
    These two lines have saved me a ton of time trying to shutdown several hosts without needing to remote desktop > logon > shutdown.
    You add Nirsoft PingInfoView into the mix for having feedback of the shutdown ones and it’s great

  19. I have noticed you don’t monetize your website, don’t waste your traffic,
    you can earn extra bucks every month because you’ve got hi
    quality content. If you want to know how to make extra money, search for: Ercannou’s essential tools best adsense alternative

  20. THANK YOU!!!! I’ve been dealing with the issue of rebooting a remote PC for months and I’ve read hundreds of web postings on what to do before a remote PC gets locked and I can’t access it. BUT nothing has ever told me what I can do at this moment… until now! You’re a genius and your postin here is very much appreciated. Thank you!

  21. This page definitely has all of the information and facts I
    wanted about this subject and didn’t know who to ask.

  22. I have a non-domain member server I need to restart and am receiving
    Access Denied 5, I’m trying this with a local account which is in the local administrators group.
    Here’s my command, any help will be appreciated!

    net use \\10.20.6.5\ipc$ /user:10.20.6.5\username password
    shutdown.exe /r /f /t 01 /m \\10.20.6.5

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.