How to trigger script on remote PC

This isn’t really an OpenHAB question but as I’ll be using OpenHAB to do this, I thought I’d question the combined wisdom of OpenHABbers.

Say OpenHAB is installed on PC 1.

I want an item to trigger a script (powershell or batch file) on PC 2.

What’s the best way to do that?

(PCs are not on the same domain so I can’t think of a way to do remote code execution…)

Some ideas to work with:
-Use something like NRPE / NSClient++ (thats what i do) to open a specific port and trigger the script on PC2 in the user context of the current logged in user on PC2 or
-VPN / SSH / Tunnel to PC2 or
-Send E-Mail to PC2, fetch the inbox, watch and match for “magic word” and trigger the script (very Aladin, i know)

BTW: Not the same domain OR not the same network?

Hey! I was asking this question myself as well. You should differentiate between the operation system on the PC in question though. For Linux remotes it is quite famous to go with ssh remote executions (see the forum for examples). That’s however not trivial and many fail at using ssh and/or the exec binding correctly.

I can recommend a solution by the help of MQTT. For Windows remotes check the following threads, there are MQTT remote control clients for other OSs as well.

Hey @ThomDietrich - I’m a bit slow to reply :wink:

Thanks for recommend WinThing. That’s exactly what I’m looking for. I also discovered nircmd. Although nircmd doesn’t actually address the original problem of getting the input from openHAB it’s an excellent / nifty little tool for actuating things on Windows machines. Every Windows power user / system manager should know about it…

1 Like

can you explain me how to install winthing ?
i don’t understand