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:
- logonuser
- impersonate
- loaduserprofile
- getenvironmentblock
- 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:
- if code necessary, happy add it, bunch didn't add far.
- the code runs fine, excel start seamlessly when not impersonate retrieve token current process , create primary token out of it
- does know how find out why excel hangs? neither eventlog, nor procmon or procexp show useful information.
- logon work without error messages (i tried logon32_logon_interactive _service others)
- for impersonation used impersonateloggedonuser c# variant without different behavior
thanks.
Comments
Post a Comment