Access denied running script when app starts process as different user(remoting)

I have a simple script that is starting a .Net application. During execution of the program, I need to start another process as a different user.
This works when done locally through PowerShell or Command prompt.
“Access is denied” is the exception thrown at the process.Start statememt.
When removing the user credentials, the 2nd program starts. I really need to start the 2nd program as a different user for connection to SQL using Windows Auth.

You’ve encountered a double hop scenario. You’ll need to look into Kerberos constrained delegation in Active Directory or enable CredSSP.

Check out our free ebook “Secrets of PowerShell Remoting” here: