c# change system service logon account information

Posted on 2006-05-22
Last Modified: 2012-08-14
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?

Question by:AlistairDyer
    LVL 28

    Expert Comment

    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.
    LVL 41

    Accepted Solution

    I'd consider using Windows Management Instrumentation (WMI)... it will allow you to make numerous changes to services to include the account/password

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now