9

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.

gregseth
  • 747

5 Answers5

10

One thing to keep in mind is that, the computers you want to shutdown must be on the same 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\IPC$ Joe /USER:Bob
2

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 https://stackoverflow.com/a/16526680/2505186. If giving me +1, also do him/her.

Tobias Knauss
  • 411
  • 2
  • 11
2

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.

gregseth
  • 747
0

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

-2

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.
slm
  • 10,859