I was wondering how could I pass a username and password of an account to
allow this page to be able to stop and start the service in the code? I have
this part


        Dim myController As New System.ServiceProcess.ServiceController("CSS
SERVER 10003")

        If myController.CanStop Then

            myController.Stop()
            myController.Start()
            Response.Write(myController.ServiceName & " Restarted.")

        Else
            Response.Write(myController.ServiceName & " cannot stop.")

        End If


if I do like I said myController.Stop() then I get access denied. I did
notice on the server that the account is defaulted to local service so I
tried network server and aspnet also. Denied. I think I have to include a
username and a password to make it work in the code. I search but can't find
anything on it.............



-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Dean Fiala
Sent: Monday, August 08, 2005 9:52 PM
To: [email protected]
Subject: Re: [AspNetAnyQuestionIsOk] Windows
ServiceAdministrationwithASP.NET ... Access denied

Mike,
Since this page is something  that I assume only admin users will be
using as it will be a bit dangerous, I'd make it a separate app and I
would use Windows Authentication for it
I would turn off anonymous access in IIS and and then set up the app
to impersonate the logged in user.
<identity impersonate="true"/>

A logged-in user with admin privileges will be able to access the service.

Giving the ASP.NET user admin priveleges means that every app on the
machine running under the ASP.NET account will have admin priveleges.


On 8/8/05, Mike Belcher <[EMAIL PROTECTED]>
wrote:
> I have the same problem this guy below has...... is this solution what I
> need to do? I noticed my service is currently running under the Network
> service account:



 
Yahoo! Groups Links



 






------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hqmssa8/M=362131.6882499.7825260.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1123560636/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to