Shutdown windows remotely

Hey fellows I tried the ‘‘apk add samba-common’’ can anyone tell me why im getting this error below:

core-ssh:~# apk add samba-common
WARNING: Ignoring APKINDEX.84815163.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.24d64ab1.tar.gz: No such file or directory
ERROR: unsatisfiable constraints:
samba-common (missing):
required by: world[samba-common]

I was trying setup WOL but cant get this to install?

I really like Hass.io but not being able to do net rpc is making me want to go back to Hassbian :frowning:

I had to do “apk update” to get the “apk add” command to work. “apk search” shows what’s available to install.

I am able to get the “net rpc” command to run, but it just says “Connection failed: NT_STATUS_IO_TIMEOUT”. I assume I have to do something on my Windows machine to make it listen, but I’m not sure what.

There is a hassio add-on to handle this.

2 Likes

Can you post your yaml config file, as I am struggling to make this work
Cheers

1 Like

Here is my working switch:

switch:
  - platform: wake_on_lan    
    mac_address: "AA-AA-AA-AA-AA-AA"
    name: "Desktop"
    host: 192.168.1.21
    turn_off:
        service: hassio.addon_stdin
        data:
            addon: core_rpc_shutdown
            input: Desktop

This is the addon settings:

{
  "computers": [
    {
      "alias": "Desktop",
      "address": "192.168.1.21",
      "credentials": "user%pass"
    }
  ]
}

Make sure u set up windows correctly too.

  • Start remote registry service
  • Open firewal for WMI
  • In registry set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\LocalAccountTokenFilterPolicy to 1 or add it.

I followed this guide http://blog.sip2serve.com/post/155565656901/shutdown-windows-10-remotely

8 Likes

Many Thanks off to try and replicate

Thanks for this!

Any idea if this can be used for sleep/hibernation instead of shutdown?

The rpc command has a hibernate option but i don’t think the addon allows you to set that option.

Still not go, it is a windows 10 issue I am sure.

I have firewalls off.

Get-NetConnectionProfile

Shows I am on a private network.
But telnet to port 445 shows Connection closed by foreign host

Remote registry is running, RPC is running. Both verified in services.msc panel. Avast disabled as well.

Netstat -ao shows the pc listening on 445 as well.

Oh the switch on the panel to activate shutdown turns off and back on when clicked. It does indicate that the service is being called.

Ideas?

So I have mine shutting down now but have needed to do the instructions as per Mosie 1 on Windows 10.

> 1. * Start remote registry service
> 2. * Open firewal for WMI
> 3. * In registry set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\LocalAccountTokenFilterPolicy to 1 or add it.

However once shutdown I cant Wake on LAN. WOL only seems to work on hibernate or sleep as per the Microsoft article.

In Windows 8, 8.1 and Windows 10, the default shutdown behavior puts the system into the hybrid shutdown state (S4), and all devices are put into D3. WOL from S4 or S5 is unsupported. Network adapters are explicitly not armed for WOL in either S5 or S4 cases because users expect zero power consumption and battery drain in the shutdown state. This behavior removes the possibility of invalid wake-ups when an explicit shutdown is requested. Therefore, WOL is supported only from sleep (S3) or hibernation (S4) states in Windows 8, 8.1 and Windows 10.
ACPI sleep states S0 to S5 . 0 being awake.

I did get mine to work! I had to perform one more restart on the RPC service in Hassio.

I ran into this problem too but I got mine to work some way. I think the problem had something to do with windows fastboot and I also adjusted some bios settings to keep my lan port powered on.

Thanks, I finally got this working. I had to update to the latest BIOS for my motherboard as well as the 2017 driver for my Realtek NIC on the motherboard. This includes a number of new green ethernet options in the driver. Now it all works with Windows fast boot.

Here are my settings

**BIOS  :** 
Enable Power on by PCI and PCie


**Lan Controller Driver :**
Power Management tab  all checked:” Allow the computer to turn off this device to save power”, “Allow this device to 
wake the computer”,” Only allow a magic packet to wake the computer”
Advanced Tab: all enabled : “Energy Efficient Ethernet “,”Green Ethernet”, “shutdown wake on lan”, “wake on Magic 
Packet”, “wake on pattern match”, WOL&Shutdown Link Speed :10Mps First

**Windows Power and sleep settings**
Balanced : 
Power Button settings , “when I press the power button : Shutdown”
Shutdown settings: all checked :”Turn on fast-start-up”, “sleep”, “hibernate”, “lock”
1 Like

Is this only possible with a local account? I tried using my Microsoft account credentials but it always says bad name/pass. I set up a local account and it works just fine.

Is there a way to add a 2nd pc to RPC Shutdown? Editing anything not in quotes prevents me from saving and I can’t figure out how to add control for more then 1 pc.

here you are:
{
“computers”: [
{
“alias”: “Tablet”,
“address”: “192.168.0.104”,
“credentials”: “username%password”
},
{
“alias”: “Desktop”,
“address”: “192.168.0.109”,
“credentials”: “username%password”
}
]
}

Perfect, thank you :slight_smile: was critically missing the , and works now.

I followed the instructions here, but still canot get it to work.

RPC addon on HASSIO tells me the following:
NT_STATUS_IO_TIMEOUT

any idea why that happens? could it be because of wrong credentials?

the add on says to provide username and password, but which username?
my microsoft account that my win10 is linked to (basically my hotmail email address) or the First and Last Name which is shown in the win10 login screen right above my password field?

Hi, i’ve found that my login name was just my first name. Your home folder should have the same name as your system account (C:\users).

well, my microsoft account first name and my microsoft email username differs completely from the c:\users folder name. and any combination did not resolve anything

frustrating…