C# implementation of "runas /netonly" using CreateProcessWithLogonW
with asynchronous stdinput and threaded stdout & stderror redirection
Main idea (most of the source) from:
Kudos to: Eric Yang [MSFT] - https://social.msdn.microsoft.com/profile/eryang/?ws=usercard-mini
Other links regarding the topic:
-
https://stackoverflow.com/questions/1973376/how-to-get-standard-output-from-createprocesswithlogonw
-
https://gist.github.com/ExtremeGTX/84ab4afb4d7cab44830fadd60101086b
-
https://gist.github.com/heri16/8f69aa919ee1d87f3bb53255ef78f188
-
https://github.com/leechristensen/Random/blob/master/PowerShellScripts/Start-ProcessAsUser.ps1
-
https://www.powershellgallery.com/packages/RunAs/1.3/Content/RunAs.psm1
-
https://github.com/FuzzySecurity/PowerShell-Suite/blob/master/Invoke-Runas.ps1
In case that some of the links are unavaiable in future, all are saved to Webback Machine: http://web.archive.org/