# Rpc shutdown windows machine

**URL:** <https://discourse.nodered.org/t/rpc-shutdown-windows-machine/29183>\
**Category:** General\
**Created:** [29 June 2020 20:01 UTC](https://discourse.nodered.org/t/rpc-shutdown-windows-machine/29183 "2020-06-29T20:01:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacopos94](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jacopos94/32/24844_2.png) [@Jacopos94](https://discourse.nodered.org/u/Jacopos94)\
**Post date:** [29 June 2020 20:01 UTC](https://discourse.nodered.org/t/rpc-shutdown-windows-machine/29183/1 "2020-06-29T20:01:52Z")

</div>

i am trying to set up a way to shutdown my windows pc remotely from nodered. as of now i managed to do it through mqtt but it doesnt always work. so i used to have a raspberry pi with home assistant on it and it had a samba integration that could send an rpc shutdown command to the pc and it would shut down no problem. since i migrated everything on nodered ( running on a qnap nas) i wasnt able to find a way to get that rpc shutdown working again. could anyone share their flow or an alternative that works reliably?

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [29 June 2020 21:43 UTC](https://discourse.nodered.org/t/rpc-shutdown-windows-machine/29183/2 "2020-06-29T21:43:32Z")

</div>

Depending on the OS of the WIndows machine - i would assume windows 10

1. Install WSL (or WSL2) - SSH to the windows machine and send a shutdown command from in the Linux shell - this can be done with SSH keys so no passwords needed (you would call an Exec node from NR to run a Bash script on the QNAP

2. Install NR on the Windows machine and send it a MQTT message to perform an exec at that end and call a Windows Batch file or PS script to perform a native shutdown

Craig

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 June 2020 11:28 UTC](https://discourse.nodered.org/t/rpc-shutdown-windows-machine/29183/3 "2020-06-30T11:28:47Z")

</div>

There are lots of ways to remotely control a Windows PC though many of them require some configuration changes to allow remote management scripting (e.g. enabling WMI).

Have you tried using shutdown from WSL? I'm not 100% sure it would work since WSL is actually a lightweight VM. You can also get remote SSH access by using the (now native) OpenSSH service that has a server component

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 August 2020 11:28 UTC](https://discourse.nodered.org/t/rpc-shutdown-windows-machine/29183/4 "2020-08-29T11:28:57Z")

</div>

Closed on 29 August 2020 11:28 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
