Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASPX : ACCESS denied when start/stop windows services

Reply
Thread Tools

ASPX : ACCESS denied when start/stop windows services

 
 
SenthilVel
Guest
Posts: n/a
 
      08-12-2004
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


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      08-12-2004
You can use impersonation to run ASP.NET under an account that has
permission to interact with windows services.
Here's more info:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


"SenthilVel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
SenthilVel
Guest
Posts: n/a
 
      08-12-2004
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



"Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You can use impersonation to run ASP.NET under an account that has
> permission to interact with windows services.
> Here's more info:
>

http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconaspnetimpersonation.asp
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
>
>
> "SenthilVel" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      08-12-2004
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


"SenthilVel" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>
>
> "Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> You can use impersonation to run ASP.NET under an account that has
>> permission to interact with windows services.
>> Here's more info:
>>

> http://msdn.microsoft.com/library/de...us/cpguide/htm
> l/cpconaspnetimpersonation.asp
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://Steve.Orr.net
>>
>>
>> "SenthilVel" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > 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
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
megha megha is offline
Junior Member
Join Date: Apr 2008
Posts: 2
 
      04-05-2008
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.
 
Reply With Quote
 
Neuron Upheaval Neuron Upheaval is offline
Junior Member
Join Date: Jan 2009
Location: Brazil
Posts: 1
 
      01-16-2009
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 by Neuron Upheaval; 01-16-2009 at 04:54 PM..
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Very annoying error: Access to the path is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity Jay ASP .Net 2 08-20-2007 07:38 PM
403 Forbidden: You were denied access because: Access denied by access control list Southern Kiwi NZ Computing 6 03-19-2006 05:19 AM
"Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\" is denied." when ASPX on remote share lee atkinson ASP .Net Security 0 11-08-2005 07:40 PM
adding main.aspx.vb & main.aspx.resx under aspx John M ASP .Net 1 05-29-2005 09:27 PM
Error saving .aspx compiled state -> access denied bruce barker ASP .Net 2 07-19-2004 09:24 AM



Advertisments