RPC is the way, but there is may be more setup to do, to allow remote shutdown:
Part of setup to do on Windows machine:
-
run “secpol.msc”
in the program tree, open “Security Settings / Local Policies / User rights Assignment”
Find the entry “Force shutdown from a remote system”
Edit the entry, add the CONCRETE user that will be used for shutdown (ex: nouknouk)
-
Run regedit.exe as Administrator
find HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System
create a new registry DWORD(32) value named “LocalAccountTokenFilterPolicy” and then assign it the value ‘1’
-
Setup remote registry service:
open “cmd.exe” as administrator
execute the two following commands:
sc config RemoteRegistry start= auto
sc start RemoteRegistry