starting a UAC elevated process from a non-interactive service (win32/.net/powershell)

后端 未结 2 2117
失恋的感觉
失恋的感觉 2020-12-23 10:38

I\'m using a thrid party Windows service that handles some automation tasks by running scripts and executables using CreateProcessAsUser(). I\'m running into problems on Win

2条回答
  •  粉色の甜心
    2020-12-23 11:09

    Depending on your use case, you could do what I do. I hunt down the winlogon process for the active session and steal its token. If there's no active session (API returned -1), use 1 if WINVER >= 6 otherwise 0. This results in SYSTEM on the active session.

提交回复
热议问题