[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1173
  • Last Modified:

c# change system service logon account information

Hi, I am would like to be able to change the logon information for a given system service.  I would like to be able to change the logon account (Username / password).  As an example I would like telnet service to run under a specified user account.  Whats the best way of going about this?

Thanks.
0
AlistairDyer
Asked:
AlistairDyer
1 Solution
 
2266180Commented:
you will do that at service installation time. when you install a service, you tipically run the executable with the /install parameter. you also provide the user & passowrd at the command line (might be wrong about this one though). OR, if it is about your service, you can programm your service to install using anotehr user/password. OR, you can go in the services console and do it from there.
in all cases, the user to be used must have the logon as a service rights granted.
0
 
grayeCommented:
I'd consider using Windows Management Instrumentation (WMI)... it will allow you to make numerous changes to services to include the account/password

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/change_method_in_class_win32_service.asp
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now