12,065,045 members (48,394 online)
The task was to run an application in the current user's privileges even though it was scheduled as a system account. It required 1.5 days R&D to get a proper solution. I have provided 3 solutions to this.
The application must be run as a local system account (use AT command). This is the prerequisite for successful execution of APIs.
sessionId of the current session, then find the current user's token, then impersonate as logon user.
I have taken the token of explorer.exe and then impersonated as a logon user.
I have taken the token of logon user and then impersonated as a logon user.
Solution by: Nitin Lokhande