How to Configure a Windows Service Logon Account
In this article
To configure the logon account for a Windows service, open Services (services.msc), right-click the service, choose Properties, go to the Log On tab, select This account, enter the username and password, then click OK and restart the service. You need local administrator rights and the account's credentials; the account must have the Log on as a service right, which Windows usually grants automatically for accounts you add this way.
What You'll Need
- Administrator access to the PC (you'll be prompted by User Account Control).
- The exact username of the account you want to use, in DOMAIN\username or .\username format for local accounts.
- The account's password.
- Knowledge of what the service does, so you can pick an account with the right permissions (for example, a backup service may need access to network shares).
Step-by-Step
- Press Win+R, type services.msc, and press Enter. The Services console opens. (Menu labels can differ slightly by Windows version, but the Log On tab is consistent.)
- In the list, find the service you want to change. You can sort by name or use the search box if your version has one.
- Right-click the service and select Properties.
- Open the Log On tab.
- Under Log on as, select This account.
- Type the account name. For a domain account use DOMAIN\username; for a local account use .\username (a single dot means the local machine).
- Click Browse if you prefer to search Active Directory or the local user list, then select the account.
- Enter the password in both password fields. If the fields are greyed out, the account you typed may be a built-in service account (like LocalSystem) that doesn't take a password.
- Click OK. Windows validates the credentials and grants the Log on as a service right if needed; if validation fails, you'll see an error and the change won't be saved.
- Restart the service: right-click it and choose Restart, or stop it and then start it. The service now runs under the new account.
- Confirm it's running: the Status column should show Running, and the Log On As column should show your account.
Common Mistakes
- Using the wrong username format. A local account needs .\username, not just username, unless the machine name is specified. Domain accounts need DOMAIN\username or username@domain.
- Typing the password incorrectly. The password fields are masked; a single wrong character causes a logon failure. Retype carefully or paste from a password manager if allowed.
- Assuming any account works. The account must have the Log on as a service right. Windows usually grants it when you set the account here, but Group Policy can override that.
- Forgetting to restart the service. The change doesn't take effect until the service restarts.
- Using a user account that gets locked out. If the service uses a normal user account and that account's password changes, the service will fail to start. Use a dedicated service account or a managed service account where possible.
- Ignoring dependencies. Some services depend on others; if you change the account on a dependency, dependent services may also need restarting.
Tips
- Use the Local System account only when the service needs full local privileges; for network access, a domain account with least privilege is safer.
- Create a dedicated service account with a strong password that doesn't expire, or use a Group Managed Service Account (gMSA) in a domain environment to avoid password rotation issues.
- Document which account each service uses; this helps during audits and troubleshooting.
- If you manage many machines, consider setting service accounts through Group Policy preferences rather than manually on each PC.
- Test the service after the change by checking its functionality, not just that it shows as Running.
Troubleshooting
If the service fails to start after the change, first check the error message in the Services console or Event Viewer (Windows Logs > System). Common errors include "Logon failure" (wrong username or password) and "Access is denied" (the account lacks the Log on as a service right or file permissions). To grant the right manually, open Local Security Policy (secpol.msc), go to Local Policies > User Rights Assignment > Log on as a service, and add the account. In a domain, this may be controlled by Group Policy, so check with your administrator. If the service starts but can't access network resources, verify the account has permissions on those resources. If the account's password was recently changed, update it in the service properties. As a last resort, revert to the previous account to confirm the service works, then reapply the change carefully.
Frequently Asked Questions
Can I use my own user account for a service?
Yes, but it's not recommended. If your password changes, the service will fail until you update it. A dedicated service account is better.
What is the difference between LocalSystem, LocalService, and NetworkService?
LocalSystem has extensive local privileges and acts as the computer on the network. LocalService has minimal privileges locally and acts as an anonymous user on the network. NetworkService has minimal local privileges and acts as the computer on the network. Choose based on what the service needs.
Do I need to restart the computer after changing the logon account?
No, restarting the service is enough. A reboot is only needed if the service is set to start automatically and you want to verify it starts correctly at boot.
Why is the Log On tab greyed out?
Some services don't allow changing the logon account through the Services console, often due to permissions or because the service is managed by another component. Check with the software vendor or use the Services console as an administrator.
Can I change the logon account from the command line?
Yes, using the sc.exe command with the config option, for example: sc.exe config "ServiceName" obj= ".\username" password= "password". Note the spaces after obj= and password=. This requires an elevated command prompt.
What happens if the account password expires?
The service will fail to start and log a logon failure. Set the service account password to never expire, or use a managed service account that handles rotation automatically.