Invoke-CommandAs icon indicating copy to clipboard operation
Invoke-CommandAs copied to clipboard

AsSystem doesn't seem to execute while device is on battery power

Open TheBlackAdderDK opened this issue 5 years ago • 4 comments

Hi I'm trying to execute some scripts, order to display some popups in the users session - and I have succeeded in this, by using the -AsSystem and combining with RunAsUser.

But... it only works, when the laptop is not on batterypower.

I can run an whoami on batterypower as my self, but as soon as the AsUser flag is added it fails on battery only.

Best regards Flemming

TheBlackAdderDK avatar Oct 05 '20 12:10 TheBlackAdderDK

I just merged a PR that might fix your issue. Please try with the latest version from GitHub.

mkellerman avatar Oct 05 '20 17:10 mkellerman

Hi Marc

The file you have changed seems to be Invoke-ScheduledTask.ps1 - my problem is with Invoke-CommandAs?

Best regards Flemming

TheBlackAdderDK avatar Oct 06 '20 06:10 TheBlackAdderDK

Try it please.

mkellerman avatar Oct 06 '20 14:10 mkellerman

Hi Marc Guess I wasn't clear enough - did try to download and replace the Invoke-ScheduledTask.ps1 file, but without any luck.

Sorry if I wasn't clear about that.

Best regards Flemming

TheBlackAdderDK avatar Oct 06 '20 19:10 TheBlackAdderDK