Click to See Complete Forum and Search --> : How to Impersonate local system account in c#


cafedreamz
May 10th, 2009, 09:35 PM
I am trying to start/stop a windows service in the code from a web application.The web application runs as IUSR_ComputerName, but this account does not have enough access rights to star/stop the service.

How do I impersonate the local system account, so that I can stop/start the service?

Rohit Kukreti
May 17th, 2009, 01:29 PM
Use the impersonate tag in web.config
<identity impersonate = "true" userName = "******" password = "*****"/>