I'm trying to run an application from our internal website. When I use Process.Start("notepad");
I can see that notepad process started in our web server with default identity mentioned in the app pool setting.
But I have to start the process with specific user name & password. So I have tried to run this line of code
string password = "XXXXX";
System.Security.SecureString securePwd = new System.Security.SecureString();
foreach (char c in password)
{
// Append the character to the password.
securePwd.AppendChar(c);
}
Process.Start("notepad", "username", securePwd, "domain");
In this case I don't even see any notepad process started in the web server. The lines of code executing because when I pass wrong password I can see my webpage throwing error of "bad username or password".
Thanks everyone for your reply. Here I got the solution and now my process start with impersonated user.
https://learn.microsoft.com/en-US/troubleshoot/aspnet/spawn-process-under-impersonated-user
Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With