RPC Shutdown Addon

Hello!
Turning off pc is not working for me. There is my config in addon:

{
  "computers": [
    {
      "alias": "Gniewko-PC",
      "address": "192.168.100.4",
      "credentials": "User%password"
    }
  ]
}

There is log from turining off:

starting version 3.2.2
[Info] Read alias: Gniewko-PC
[Info] Shutdown Gniewko-PC -> 192.168.100.4
Bad SMB2 signature for message
[0000] 00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00   ........ ........
[0000] F5 10 F4 0B AB A1 A2 08   54 87 AE 2F A8 A3 4B 9B   ........ T../..K.
Could not connect to server 192.168.100.4
Connection failed: NT_STATUS_ACCESS_DENIED
Bad SMB2 signature for message
[0000] 00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00   ........ ........
[0000] 87 8F 14 BD 0C 99 4E 7D   9A 73 66 7C 6A 80 8E 92   ......N} .sf|j...
Could not connect to server 192.168.100.4
Connection failed: NT_STATUS_ACCESS_DENIED
[Error] Shutdown fails -> 

There is my configuration.yaml including a wake on lan section aswell:

switch 2:
  - platform: wake_on_lan
    mac_address: "4C:CC:6A:96:D2:19"
    name: Gniewko-PC
    host: 192.168.100.4
    turn_off:
        service: hassio.addon_stdin
        data:
            addon: core_rpc_shutdown
            input: Gniewko-PC

Any ideas? What that errors means? Can u give me a answers?

Has your computer been setup to accept the remote shutdown command?

The note from the docs states…

The user specified in the credentials should be an applicable user listed in C:/Users . This may differ from the username used to login to Windows. Depending on your settings and privileges within Windows, changes to the firewall, UAC (User Account Control) and registry settings may be required to allow this add-on to remotely shut down your computer. There are many guides available online on how to adjust these settings.

1 Like

I tried to, mby u have more specific commands/tutorial/info? User os 100% right. I saw that info before. I tried a few commadn aswell, disabling firewall etc, i just need specific step by step commands to execute.

Up Please :slight_smile:

This is how i got it working:

On windows open the start menu and write REGEDIT, then press enter.

  • Navigate to HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System.
  • Create the DWORD value LocalAccountTokenFilterPolicy
  • Modify the value of LocalAccountTokenFilterPolicy by changing the Value data to 1
4 Likes

If you are trying to shutdown a windows 10 machine, I found this link very valuable: The Hassio part was easy lol. Shutdown Windows 10 remotely - Techy Findings

1 Like

Did u figured it out? Because I got it up and running this morning, might be able to help if it still didn’t work out for you.

Hi, i have the same error message, “Bad SMB signature message” and can’t figure it out. I add the LocalAccountTokenFilterPolicy set to 1, I did set my samba options to acces my HA files, but i need help do shutdown this PC please !

i tried this solution but it didn’t work for me. i am running windows 10 Home on my laptop and I followed the steps in the registry editor but when I run rpc shutdown in home assistant I get “The username or password was not correct”. the username is the user in “C:\Users” and password is my Microsoft account password. Is there something wrong in my setup?

Hi Hassan, I have documented my steps. You can contact me via [email protected] since I am not at home atm. Happy to share my document with you.

1 Like

i am still getting the same error “the username or password was incorrect” how to double check my username and password?

Wanted to say thanks for sharing this document. It’s a real treasure trove for a total noob home automation enthusiast with no coding experience. Got RPC to work correctly (creating and populating the switches.yaml file and tying it into configuration.yaml plus the registry edit and wake packet setting).

Many, MANY(!) thanks

1 Like

Hi Mark,

Thanks for the reply. Happy to hear it helped other people to get things started! I indeed, wrote it for n00b purposes, since these were, and sometimes still are the things I run into. Actually used it myself sometimes to reconnect things after internet provider change. If you have any questions just let me know, I am not an expert at all, but it seems we are all running into the same issues from time to time and I think the community is the way to go:).

1 Like

Figured this out this afternoon:

Of course, first follow documentation regarding IP-address and user-credentials of the machine you wan’t to shutdown remotely. Also, don’t forget the regedit LocalAccountTokenFilterPolicy RoyD2 spoke about.

When that’s done, on the remote machine:

Go to Windows Firewall (Start > Run > wf.msc), go to ‘Inboud Rules’.
Enable ‘Remote Service Management (NP-In)’.

Trying to shutdown a QNAP , getting this error.
[15:53:48] INFO: Shutdown QNAP → 192.168.1.5
Shutdown of remote machine failed
result was: WERR_ACCESS_DENIED
[15:53:48] ERROR: Shutdown fails →

Windows PC’s no problem. Any ideas?

RPC shutdown is for Windows PCs.
You coud try to shutdown the QNAP via script, SHELL commands and SSH.