Executing PowerShell scripts from C# .NET 6 web app using RunImpersonated not working – Scripts still execute as IIS APPPOOLAPP
My app needs to execute PowerShell scripts to create and manage AD accounts. My current setup uses HangFire to launch background jobs, PowerShell execution being one of them. I have an ImpersonationService setup that Uses RunImpersonated
and RunImpersonatedAsync
methods of WindowsIdentity
.