Start/Stop service from an ASP . NET page
I implemented a web page (ASP .NET, VB) to start/stop a Windows service. I used impersonification, as described here: http://support.microsoft.com/kb/306158 Everything it's ok when the page reads the service's status: _domain = Me.TextBoxDomain.Text _user = Me.TextBoxUserName.Text _password = Me.TextBoxPassword.Text _s = New ServiceController(Constant.ServiceName) If impersonateValidUser(_user, _domain, _password) Then Me.LabelServerStatusValue.Text = _s.Status.ToString undoImpersonation() Else 'Error End If The problem occurs when the page tries to start (or stop) the service: _domain = Me