Shutting down windows clients using HA

Hello, I’ve been trying to send a shutdown command to a windows client using shell_command. The client are on a LAN and the command works is windows command line.

I don’t understand why it doesn’t work, do you have any suggestions?

configuration.yaml

shell_command:
  windows_shutdown_prod: net use \\Production /USER:spillhuset\administrator PASSWORD && shutdown /s /t 10 /m \\Production

Script:

poweroff_prod:
  alias: poweroff_prod
  sequence:
  - service: shell_command.windows_shutdown_prod
    data: {}
  mode: single

Have you looked at the add-on RPC Shutdown?

Yes, but I didn’t manage to get that workin either.

This works. GitHub - LAB02-Research/HASS.Agent: Windows-based client for Home Assistant. Provides notifications, quick actions, commands, sensors and more.