Click here to Skip to main content
16,013,440 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,
I have a windows form that manipulate a windows service with service controller.
When I try to start it, the application return me "access denied".
If I run the application as admin, I can start it and stop it.
If I run the application as normal user i can't do anything.
I have to impersonate a user who has admin permission on a machine and then manipulate that.
Any idea?
Thank you very much
Posted

1 solution

 
Share this answer
 
Comments
gregorio89 5-May-15 3:24am    
I have already follow this post
http://www.codeproject.com/Articles/14358/User-Impersonation-in-NET
but if I impersonate my user on my machine I can't do anything.
Richard MacCutchan 5-May-15 4:22am    
Sorry, you need to edit your question and explain exactly what the issue is. We cannot guess what "I can't do anything" is supposed to mean.
gregorio89 5-May-15 4:34am    
i'll try to explain:
If I try to start a service with my user (without permission), I obtain
Impossible to start service "service name" on the computer "computername".
If I try to start a service with a domain user (with permission),
I obtain "the service did not start due to an error when accessing".
Richard MacCutchan 5-May-15 4:39am    
Well, again, we cannot guess what error. You really need to collect some proper information if you want people to help you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900