mkellerman / Invoke-CommandAs

Invoke Command As System/Interactive/GMSA/User on Local/Remote machine & returns PSObjects.

Home Page:https://www.powershellgallery.com/packages/Invoke-CommandAs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

TheBlackAdderDK opened this issue · 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

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

Hi Marc

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

Best regards
Flemming

Try it please.

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