I'm not quite sure if this is the right place for this question, but here goes. I have an interesting situation, let me explain:
I have some WCF services that I need to host in IIS7. This .NET code is to help do administration of our email for students and employees at our university. Students are on Outlook Live, employees are on Exchange 2007. The code needs to establish a remote powershell session with Outlook Live to run some cmdlets as well as do powershell for Exchange 2007. Due to what the code is doing, it needs to run with elevated privileges using a service account. I have setup a new application pool and have it running under this service account. I then have my WCF services running in this application pool.
What I am finding is that when I call a service method that needs to remote powershell to Outlook Live, I am unable to establish a connection and the error that powershell gives me is "An internal error occurred." The interesting this is that if I change the WCF services to run under the DefaultAppPool (Network Service user) it can open a remote powershell session with Outlook Live just fine. I can also log into the server as the service account and use the integrated powershell environment to establish a remote powershell session with Outlook Live and run cmdlets just fine. It appears that it does not like running remote powershell from an Application Pool that is not running as "Network Service" (DefaultAppPool).
I have all of the versions of powershell, winRM, Exchange Management Tools, etc. installed. I am not sure why running my services under "Network Service (DefaultAppPool)" allows the remote powershell and running under my service account does not. I really appreciate any help and thoughts.