ASPX : ACCESS denied when start/stop windows services

S

SenthilVel

Hi All

i do need to control my windows services using aspx pages.

I used the System.ServiceProcess.ServiceController namespace ....
this is working fine when i run my code in a windows application .

But when i use the code to start /Stop the service in a aspx page i get an
error like:

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.ComponentModel.Win32Exception: Access is denied


so what must i do in settings or in permission levels so that i can run the
service start/stop code in ASPX pages??

can any one explain what to do in detail..

,,,,
Senthil
 
S

SenthilVel

Hi Steve
i added the impersonate="true" in my config files.
but still i am not able to access the services from aspx pages.
it says " permission denied".
what to do ?

,,,,
Senthil
 
S

Steve C. Orr [MVP, MCSD]

Give it a specific username and password to use.
For testing, give it your username and password so it will run with your
security privileges.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
 
Joined
Apr 5, 2008
Messages
1
Reaction score
0
Same problem

I m having same problem. i m trying to access windows service from my web application. but it is giving access denied error.
please let me know if u find any solution.

Thnks in advance.
 
Joined
Jan 16, 2009
Messages
1
Reaction score
0
This worked for me

Hi!

I have a web application which connects to a Windows service running in another computer, and some information about this service is retrieved using System.ServiceProcess.ServiceController interface.

Whenever I opened the web application, it used to hang with the same "Access denied error" as described above.

The workaround was to include the following node to the <system.web> node located inside the web application's Web.config file:

<identity impersonate="true" userName="userName" password="password" />

where userName and password are the logon attributes of an user with enough security rights on the service-running computer.
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top