Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

How can I create a System.Diagnostics.Process that uses the LOGON_NETCREDENTIALS_ONLY flag?

$
0
0

I am writing a program that spawns child processes and those child processes need to use a credential that is not local on the machine when accessing network resources I need to spawn those processes with the LOGON_NETCREDENTIALS_ONLY flag. I want to use the System.Diagnostics.Process library since I already have a huge investment into it and it's wired up with intercepted IO. Is there any way I can tell Process internally to use the LOGON_NETCREDENTIALS_ONLY flag when calling CreateProcessWithLogonW when credentials are provided? Since the account does not exist locally on the box I will get access denied without the flag in play. I've looked everywhere and the only solution I've found is to implement CreateProcessWithLogonW which means I have to also interop all of the stream interaction code and everything else already wired to the Process object and I would like to avoid that if it at all possible. Even if there is a way to inherit Process and add the flag that way I could go that route, I just need advise.

Thanks,

Jerry


Dev


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>