Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 3 "client" computers, on which the mentioned user is administrator:

CPU1: Win Vista 32-bit -- User: Domain\User1    -- IP: 192.168.42.1
CPU2: Win 7 64-bit     -- User: localhost\User2 -- IP: 192.168.42.2
CPU3: Win 7 64-bit     -- User: Domain\User3    -- IP: 192.168.42.3

And a "target" computer (the one that I want to shutdown from the three others):

TGT: Win 7 64-bit      -- User: localhost\User4 -- IP: 192.168.42.21

I'm trying to shutdown TGT with the following command:

shutdown /s /m \\192.168.42.21

It's working from CPU1 (meaning TGT shuts down), but from CPU2 and CPU3 I get the following message:

Access denied. (5)

What am I to understand? What should I do to get it working form all of my computers.

share|improve this question
    
Does TGT belong to the same domain? Does TGT have a local account named "User2"? Do Domain\User1 and Domain\User3 have identical privileges on the domain? – grawity Mar 21 '12 at 12:18
    
TGT doesn't belong to the domain nor has any local account named 'User1', 'User2' or 'User3'. – gregseth Mar 21 '12 at 12:21
3  
TGT needs to know who User1, 2 and 3 are, and authenticate them, or it won't work. Else people would be running around the web shutting eachothers computers down. – cutrightjm Mar 21 '12 at 12:24
    
Ok then, but 1. how do I authorize them? and 2. why is it working from CPU1? – gregseth Mar 21 '12 at 12:38
    
Nitpick: CPU1 is not a CPU. It is probably a computer with one or more CPUs (which are chips). – Hennes Oct 18 '13 at 20:10

create a local account on tgt for each user account you want to use to shut the machine down remotely. each of these accounts must have admin priviledges on tgt and have the same name and password as the accounts you use on cpu1-3. cpu1 probably uses an account that is created with the same name and pass on tgt

share|improve this answer
    
Creating other accounts on TGT is not an option. And no, TGT and CPU1 have no user in common. – gregseth Mar 21 '12 at 12:53
    
not the user, the username – nstraub Mar 21 '12 at 16:56
    
Could you be more explicit? I don't really get the difference. Thanks. – gregseth Mar 21 '12 at 20:15
    
if you make a user called user1 with password 12345 with administrative priviledges on both tgt and cpu1, you can then access tgt from cpu1 and it will recognize your credentials as its own. in other words if both pcs have a user with the same name and password, you can call shutdown and it will work transparently – nstraub Mar 26 '12 at 20:25
    
@Ramhound No, windows does behave like this. It will attempt to connect to a non domain computer using the currently logged in user's username and password first before displaying the password prompt. – Scott Chamberlain Jun 13 '13 at 0:14

One possible answer is to use PS Shutdwon:

 psshutdown.exe \\192.168.42.21 -s -u User4 -p User4Password

But it's not valid answer, I'm still looking to do it natively because the sysinternal tools are not redistribuable.

share|improve this answer
1  
"because the sysinternal tools are not redistribuable." They are Microsoft tools this statement makes no sense. – Ramhound Jul 11 '12 at 13:47
1  
Quoting the license file: "No part of PsTools may be redistributed in any way, or by any means, without the prior written permission of Sysinternals LLC." That sounds pretty clear to me. – gregseth Jul 23 '12 at 7:11
    
@gregseth you can download and use the tools on your computer(s), but you cannot package them into your own software bundle. That's what redistribution means. – icelava Jun 30 '15 at 4:39
    
@icelava Thank you, I know what redistribuable means. And since the sysinternal tools are not redistribuable, I was looking for a native solution (or any other) that I can ship with my software. – gregseth Jun 30 '15 at 12:34
    
@gregseth you never mentioned such a requirement in the question. – icelava Jul 6 '15 at 20:45

One thing to keep in mind is that, the computers you want to shutdown must be in the same Wi-Fi network as the "controlling" computer.

There are many solutions to this, I simply chose this one.
This is a simple network access issue. You will have access to certain computer some times, but that is not this case. To gain access of another computer for you to remote shutdown, you must execute the follow command in command prompt:

net use \\Server\IPC$ pswd /USER:user

Replace Server with the computer ip/name you want to shutdown remotely, pswd with the password to any administrator account of the remote computer and user with the Administrator user account name. To list all the computers in your current Wi-Fi network, do net stat. It'll give you the names of the computers. Unless you prefer an easier way: Click Start, then Right-Click Computer. Click properties, it should be named in there. IPC$ is supposed to be there. Sometimes it will not work. I do not know why.

Work cited here.

For example, we'll have a computer named CHOCOLATE, and an Administrator account on the current machine is Bob and the password is Joe:

net use \\CHOCOLATE Joe\IPC$ /USER:Bob
share|improve this answer

First you must authenticate on the target PC to remotely execute operations.
This can be done in multiple ways:

  • you are local admin have the same account (username and password) on the remote PC (also local admin). Then the correct logon credentials are sent automatically.
  • you create a connection to the target PC and provide the logon credentials of an admin user of the target PC. The shutdown command does not send any logon credentials, so you need to find another way. On solution is connecting a network share. And you don't have to create one just for this purpose, you can use the existing IPC$, which I also do.
    net use \\target-pc\\IPC$ password user:username

But in order to run the shutdown successfully, you have to get over another issue: The remote UAC restricts the user rights if logged on from remote. This blocks your shutdown execution.
See on Microsoft KB951016 for details. The 'workaround' is also described there.
I found this last important info on various pages in the internet after wondering why my shutdown did not work. It is also on http://stackoverflow.com/a/16526680/2505186. If giving me +1, also do him/her.

share|improve this answer

in order to use remote shutdown in windows 7:

  • First go to the computer that you want to shutdown and create user with the same name/password of the user you use to shutdown the computer.
  • Then add the user to the Administrators group.
  • Then go to Control panel/Administrative tools/Local Security policies.
  • Then click on local policies.
  • Then user right assighnments and scroll down until you find force shut down remote computer, check if the administrators group is there.
  • Now you need to disable user account control (UAC) because it blocks the shutdown command.
  • Last thing is to enable remote desktop from local policies user right assigments remote desktop and add the user that you created, and right click on computer and properties, remote settings, enable remote desktop, and add the user you created it.
share|improve this answer
    
The users per the original post are already administrators. – Ramhound Feb 6 '13 at 16:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.