Windows Service Tips

A windows svc. Can be configured to run under any account.

Please follow the instructions to deploy your windows service under a specific account:

  1. RunĀ  this command in command prompt : c:\WINDOWS\Microsoft.NET\Framework \ v4.0.30319\installutil “Physical Path of the Service”. This will install the service.
  2. Now open services.msc
  3. Right click on your svc. and open its Properties
  4. In the Log On Tab, enter the credentials of the Account that you want to run the service under.
  5. Click Apply, and start the service.

Note that there are two ways to assign the minimum rights required to run a windows service as a domain account:

  1. Edit the properties of the service and set the Log On user. The appropriate right will be automatically assigned.
  2. Set it manually: Go to Administrative Tools -> Local Security Policy -> Local Policies -> User Rights Assignment. Edit the item “Log on as a service” and add your domain user there.

I have used 1 in my instructions above and have verified that it works for Windows Server 2003 and Windows 7.