I have an identity impersonate setting on webconfig. I am trying to connect to the exchange mail server from c# but instead of using identity impersonate from web.config, the runspace.open() command uses identity from application pool. And ends up giving me access denied error.
I have checked the identity impersonate is working for that page.
If i put the same credentials as web.config impersonate on applications pool identity, then it works but I dont want the whole application to run using that credential. I want to run just the single page that connects to mail server using the identity in web.config?
My problem is similar to the unsolved problem here.
http://forums.asp.net/p/1771787/5554766.aspx?Re+net+and+remote+powershell+sessions
Can anyone help me?