A windows svc. Can be configured to run under any account.
Please follow the instructions to deploy your windows service under a specific account:
- 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.
- Now open services.msc
- Right click on your svc. and open its Properties
- In the Log On Tab, enter the credentials of the Account that you want to run the service under.
- 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:
- Edit the properties of the service and set the Log On user. The appropriate right will be automatically assigned.
- 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.