Re: Change NT Service user name and password after installation

From: Bruce Parker (bparkerhsd_at_nospam.nospam)
Date: 02/25/05


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



Relevant Pages

  • Re: Change SQL Service Account
    ... One could be that the account you are using does not have permissions to start a service or your account has been locked out due to other reasons while you are logged in. ... Another is not enough permissions on the account to do what it needs to do as a SQL Server service account. ...
    (microsoft.public.sqlserver.setup)
  • Re: Incoming E-Mail - cant create contact in OU
    ... account out of local administrator to attempt to find any denied access. ... I then added full permissions to my user account on both of these keys, ... local admin rights to the server hosting incoming email. ... what permission I need to give the app pool locally to avoid this issue. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Incoming E-Mail - cant create contact in OU
    ... account out of local administrator to attempt to find any denied ... I then added full permissions to my user account on both of these keys, ... that's for every app pool you create for every new web app on the ... local admin rights to the server hosting incoming email. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Win2k - Account Operator not working properly
    ... You very likely have other ACL issues other than what was mentioned and I can point them out here for you for free or you can pay someone $200-500 an hour to come check it out. ... In order for that to result in inheritence protection it means the schema had to be modified. ... set the account in the GUI to inherit from its parents. ... Used the delegation wizard, on the top level OU, to assign the desired permissions. ...
    (microsoft.public.windows.server.active_directory)
  • Consider Windows XP File Security and Group Policies
    ... If you are running Windows XP and are using the NTFS file system, ... Account from being able to purge its history footprint files. ... Changing Folder permissions to Read-Execute instead of Full ... you globally apply Full Control for the Administrators group and the SYSTEM ...
    (microsoft.public.windowsxp.general)