c# - Excel does not start correctly when impersonating users running as a service -


running excel service not recommended, know. :-)

problem: starting excel windows service work fine. multiple instances can work side side seamlessly. problem arises necessity run queries against analysis services. unfortunately user id/ password properties of analysis services connection not used when not using http protocol. msas ole db connection pass on user of running process. makes necessary not start excel service impersonation beforehand. (if has better idea here, welcome!)

to let excel impersonated process.start in c# not work anymore uses createprocesswithlogonw under hood leads access denied error message when running service while trying load user profile.

steps:

  1. logonuser
  2. impersonate
  3. loaduserprofile
  4. getenvironmentblock
  5. createprocessasuser

the problem after isnt excel doesnt start @ or gives error messages, doesnt have windows. threads available no windows iterate.

is there out there having experience that?

note:

  1. if code necessary, happy add it, bunch didn't add far.
  2. the code runs fine, excel start seamlessly when not impersonate retrieve token current process , create primary token out of it
  3. does know how find out why excel hangs? neither eventlog, nor procmon or procexp show useful information.
  4. logon work without error messages (i tried logon32_logon_interactive _service others)
  5. for impersonation used impersonateloggedonuser c# variant without different behavior

thanks.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -