diff --git a/agent/rpc.go b/agent/rpc.go index a745ed3..aaaefe2 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -349,7 +349,7 @@ func (a *Agent) RunRPC() { ret.Encode("ok") msg.Respond(resp) if runtime.GOOS == "windows" { - CMD("shutdown.exe", []string{"/s", "/t", "5", "/f"}, 15, false) + CMD("shutdown.exe", []string{"/s", "/t", "5", "/f", "/c", "Shutdown initiated by RMM agent.", "/d", "e:0:0" }, 15, false) } else { opts := a.NewCMDOpts() opts.Command = "shutdown -h now" @@ -365,7 +365,7 @@ func (a *Agent) RunRPC() { ret.Encode("ok") msg.Respond(resp) if runtime.GOOS == "windows" { - CMD("shutdown.exe", []string{"/r", "/t", "5", "/f"}, 15, false) + CMD("shutdown.exe", []string{"/r", "/t", "5", "/f", "/c", "Reboot initiated by RMM agent.", "/d", "e:0:0" }, 15, false) } else { opts := a.NewCMDOpts() opts.Command = "reboot" diff --git a/agent/tasks_windows.go b/agent/tasks_windows.go index 3ccdead..0450795 100644 --- a/agent/tasks_windows.go +++ b/agent/tasks_windows.go @@ -266,7 +266,7 @@ func (a *Agent) CreateSchedTask(st SchedTask) (bool, error) { case "schedreboot": path = "shutdown.exe" workdir = filepath.Join(os.Getenv("SYSTEMROOT"), "System32") - args = "/r /t 5 /f" + args = `/r /t 5 /f /c "Reboot scheduled by RMM agent." /d p:0:0` case "custom": path = st.Path workdir = st.WorkDir