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

On July 29, 2011, in How-to, by Cubert aka (Cube Dweller)

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

Tagged with:
 

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

  1. JCB says:

    Briljant !!!

    thx

  2. Frank says:

    Thank you so much Cubert!

  3. Thomas Magle Brodersen says:

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

  4. Marius says:

    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.. 😛

  5. igor says:

    Excellent, this is what I was looking for.

  6. igor says:

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

    Worked when I used IP instead.

  7. Tarras says:

    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.

  8. Marion says:

    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 ?

  9. Vadivu says:

    Its working fine.. Thanks a lot for this information!

  10. mhmd says:

    tnx
    But it return following error:

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

  11. Scottly says:

    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

  12. Jim says:

    What should be entered for the password if there is no password?

  13. marwyn says:

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

  14. Chandra Maruthy says:

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

  15. Greg says:

    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?

  16. […] How-to : Pass a username and password to Windows shutdown.exe command. […]

  17. SjamonDaal says:

    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)

  18. Lewis says:

    So what’s the IPC share?

  19. francis says:

    thank you very much, you rock!!!!!!!!!!!!!!!!

  20. Gokul says:

    wow… super thanks man

  21. Sarvar says:

    still says, Access is denied.(5)

  22. Sarvar says:

    plz reply what to do

  23. Joey says:

    Like it! Helped immensely! Thanks!!!!

  24. Radu says:

    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.

  25. DEVESH says:

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

  26. GameAddict says:

    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

  27. H says:

    Outstanding! Thanks for the tip.

  28. Ben says:

    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!

  29. M O'Connor says:

    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

  30. Ashton says:

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

  31. Dhruv says:

    It did help me. Thanks for your guidance.

  32. Hi everyone, it’s my first pay a quick visit at
    this web page, and article is actually fruitful in support
    of me, keep up posting such posts.

  33. Mohammed says:

    Works for me!. Thanks 🙂

  34. Pacopil says:

    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

  35. BestEmmett says:

    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

  36. 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!

  37. moaz says:

    if server what i use is don’t have a password what i will type

  38. moaz says:

    if i don’t have a password what i will type

  39. Isis says:

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

  40. Brocador says:

    Man, you saved me! THANK YOU!

  41. PRymek says:

    It’s a simple and effective solution. Works for me! Many thanks.

  42. Chris says:

    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