`Switching off Windows Home Server via net rpc command

Hello everybody,

I sucessfully integrated a switch item to turn on and off my Windows Home Server v1 in my configuration.

The following setup works as expected using the wol and exec bindings:

Item configuration:

Switch Server "Server" ["Lighting"] {wol="AAA.BBB.CCC.255#AA-BB-CC-DD-EE-FF"}

Rule configuration:

rule "Switch the Server off via Exec"
	Item Server received update OFF
then {
	logInfo("RULE", "Server is switched off")
	val String FeedbackScript = executeCommandLine('sudo net rpc shutdown -I AAA.BBB.CCC.DDD -U user%password -f', 10000)
	logInfo("RULE", FeedbackScript)

However, although this implementation works, it bothers me, that my password is explicitly stored in the openHAB configuration.

With a Linux server it would be possible to use a keypair instead of storing a password. Is there something comparable for a Windows server?



Not through rpc. I think you can get an ssh service timing on Windows and there might be some magic you can do through PowerShell, which if I recall correctly, in now anime on Linux.