How would I go about running an EXE as a different user? How could I prompt for credentials or atleast ask for the password for a local admin to launch an exe through powershell. I'm having a hard time getting the runas command to work.
This was the latest thing I tried: runas -credential .\me c:\windows\system32\notepad.exe
This works in the powershell terminal: runas /user:asdf c:\windows\system32\notepad.exe but doesn't ask for credentials in a standalone powershell script.
Start-Process
andInvoke-Command
are used to run commands (PS or external) as if they were run from the commandline. – Aficionado