Why does your windows service lose its password on restart?
This is probably occurring because:
- You are using a Domain Account as the user to run the service as
- Your default domain policy (or another GPO) have explicitly listed which users are granted the “Login as service” right (and user from #1 is not in that list)
How to fix the problem:
1. Start up Group Policy Management Console on your Domain Controller (click start -> run -> type in “gpmc.msc” (no quotes) -> hit OK
2. Locate your default domain policy
3. Modify the following policy and add the account you wish to always have the “Login as a service” right:
Computer Configuration -> Windows Settings -> Security Settings -> Local Policies/User Rights Assignment -> Log on as a service