Error: Cannot validate argument on parameter ‘Session’. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. [dcName] An error has occurred which PowerShell cannot handle. A remote session might have ended.
Service Account Web App Pool is running under has permissions on DomainAdmins JEA endpoint. Outside of Web Front End, New-PSSession command above works without issues under Service Account credential.
This is major showstopper since I prefer using JEA concept whenever possible. Any help would be appreciated.
I dont have an answer to your ? (other than the fact that $Session is null, hence the error), however, this sounds like a bad idea to me from a security perspective.
This is from a google search:
Yes, running an IIS application pool as "Domain Admins" is generally considered a very bad idea because it grants the application pool excessive privileges, posing a significant security risk; it's best practice to create a dedicated, least-privileged service account for each application pool instead