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
Briljant !!!
thx
Thank you so much Cubert!
Wow, didn’t even know this was possible! Will save me a lot of trouble from now on!
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.. 😛
Excellent, this is what I was looking for.
The only thing is that it did not take server name, I was getting error 52.
Worked when I used IP instead.
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.
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 ?
Its working fine.. Thanks a lot for this information!
tnx
But it return following error:
System error 53 has occurred.
The network path was not found.
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
What should be entered for the password if there is no password?
Jim, what do you enter if you login to account with no password? Nothing! So try the same approach 😉
Thanks. Had to “allow” File and Printer sharing through firewall in remote PC before it actually worked. Your tip offered a breakthrough.
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?
[…] How-to : Pass a username and password to Windows shutdown.exe command. […]
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)
So what’s the IPC share?
thank you very much, you rock!!!!!!!!!!!!!!!!
wow… super thanks man
still says, Access is denied.(5)
plz reply what to do
Like it! Helped immensely! Thanks!!!!
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.
need help
everthing was right.
command completed succesfully
BUT IT STILL SHOWS ACCESS DENIED (5)
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
Outstanding! Thanks for the tip.
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!
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
If you get an access denied, try running the command from an elevated command prompt (Run as Administrator)
It did help me. Thanks for your guidance.
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.
Works for me!. Thanks 🙂
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
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
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!
if server what i use is don’t have a password what i will type
if i don’t have a password what i will type
This page definitely has all of the information and facts I
wanted about this subject and didn’t know who to ask.
Man, you saved me! THANK YOU!
It’s a simple and effective solution. Works for me! Many thanks.
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