How to grant LogOnAsService during install?

  • Thread starter Thread starter mdb
  • Start date Start date
M

mdb

I'm using an Installer class to install my windows service. I want to
configure it to log on as a user. When I did this, it worked at first, but
after about a day it wouldn't work anymore. When I try to start the
service it was complaining that it couldn't start due to a logon failure.

I then changed the password in the service configuration (actually I just
typed the same password again since I'm sure it was correct) and it then
said that the account had been granted LogOnAsService rights.

How can I have the InstallUtil / MSIInstaller grant this right during
installation?

-mdb
 
mdb said:
I'm using an Installer class to install my windows service. I want to
configure it to log on as a user. When I did this, it worked at first,
but
after about a day it wouldn't work anymore. When I try to start the
service it was complaining that it couldn't start due to a logon failure.

I then changed the password in the service configuration (actually I just
typed the same password again since I'm sure it was correct) and it then
said that the account had been granted LogOnAsService rights.

How can I have the InstallUtil / MSIInstaller grant this right during
installation?

-mdb

This is done automatically.
In your service you specifiy the account under wich it will run, when you
specify an account that hasn't this privilege, the installer will grant this
privilege to this account when installing.

Willy.
 
Back
Top