is it possible to make a switch and when this is switched on, a powershell script executed remotely on another system or a Linux script on another Ubuntu machine? Alternatively, I would be happy if i could write the status of a switch in a text file, then I would get it from outside when it changes and then do something with it…
You probably have to define what access you have to the other machine.
Windows machines can make RPC calls, just see the RPC shutdown add-on. Linux have many options with different programs, but if those can not do it, then a SSH script will practically always handle it.