Re: Change NT Service user name and password after installation
From: Bruce Parker (bparkerhsd_at_nospam.nospam)
Date: 02/25/05
- Next message: Hugo Batista: "Re: design pattern"
- Previous message: RandomEngineer: "System.Random Algorithm"
- In reply to: Sean Hederman: "Re: Change NT Service user name and password after installation"
- Next in thread: Sean Hederman: "Re: Change NT Service user name and password after installation"
- Reply: Sean Hederman: "Re: Change NT Service user name and password after installation"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 25 Feb 2005 10:25:01 -0800
The service has to run under a specific account that we specify to the
customer. There are a lot of reasons for this but would take too long to
explain. I need a programmatic way to modify the user name and password.
The service is a .NET service and I want to perform the check in the OnStart
event. If this is not possible, I do want to launch a .NET executable to
perform this task.
How do I do this programmatically through .NET?
"Sean Hederman" wrote:
> I'd say that your service should launch an external app which will perform
> the restart. Unfortunately if the user that your service is logged in as
> doesn't have permission to start and stop services, and change service
> permissions then this won't work.
>
> Is there any particular reason you want to limit the user name? I would be
> very unhappy if a service told me what user name it wanted. Surely all the
> service really need is the correct permissions? Also, I'd classify any
> service which elevated it's own privileges as a serious security risk.
> Rather just fail on start and write to the event log what you want to
> happen. Then the system administrator can decide what to do.
>
> Also, if you're looking at changing to one of the standard user id's beware
> about localization issues. Also keep in mind that many network admins remove
> the standard user names off their systems. One I know has no Administrator
> accounts on any machine.
>
> "Bruce Parker" <bparkerhsd@nospam.nospam> wrote in message
> news:67E1A786-F70D-4DA3-B5F0-70FCCE72377D@microsoft.com...
> > Is there a way to change a NT Service's user name and password after it
> > has
> > been installed. I want to perform a check for the user name in the
> > On_Start
> > event of the service. If it is not the one I want I want to change the
> > user
> > name and password and then allow the service to start.
>
>
>
- Next message: Hugo Batista: "Re: design pattern"
- Previous message: RandomEngineer: "System.Random Algorithm"
- In reply to: Sean Hederman: "Re: Change NT Service user name and password after installation"
- Next in thread: Sean Hederman: "Re: Change NT Service user name and password after installation"
- Reply: Sean Hederman: "Re: Change NT Service user name and password after installation"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|