I am attempting start and stop windows services via HA using net rpc. I have the commands successfully starting and stopping services on a windows pc on the network via the web terminal add-on but can’t get them to run in a shell_command in the configuration.yaml.
Abbreviated error message down to the basics from the logs:
Error running command: `net rpc`, return code: 127
I understand this means that the command
net isn’t installed and so the command couldn’t be found. I installed the required samba toolkit in terminal to get it working but from my limited understanding, I am lead to believe the command is running in a different container to the terminal add-on.
To get HA running, I simply followed the guide on home-assistant.io and installed it directly on an SD card, I didn’t specifically set up docker instances. My knowledge on docker containers and Linux is pretty limited, I am very much a windows dev.
Shell command which I am testing via the developer tools:
test_net: "net rpc"
Do I need to go down the complicated route of setting up ssh’ing to the other container or is there a simpler way to get this shell_command to work?
Actual commands I want to use (that work, with different creds, via the terminal add-on):
start_service: "net rpc service start CustomService -I 192.168.1.64 -U user%password1"
stop_service: "net rpc service stop CustomService -I 192.168.1.64 -U user%password1"