---
title: "How to Set 'Logon as a Service' Rights for Nodinite Windows Services: Security and Best Practices"
description: "Learn how to securely configure 'Logon as a Service' rights for Nodinite Windows Services. Step-by-step guide for least-privilege, secure, and compliant deployments."
---

# :fa-user-plus: Logon As A Service

Empower your :Nodinite: environment with secure, least-privilege service account management. This guide explains how to configure 'Logon as a Service' rights for :Nodinite: applications and services running on Windows Servers, ensuring compliance, security, and smooth operations across your infrastructure.

* ✅ Step-by-step instructions for setting 'Logon as a Service' rights  
* ✅ Ensures least-privilege, secure deployments  
* ✅ Supports multi-server and multi-environment scenarios  
* ✅ Best practices for password, policy, and account management  

>[!INFO]
>On this page, you will learn the **minimum** privilege required for any :Nodinite: Windows Service to run on the hosting [Windows Server][Windows Server Monitoring Agent].
>[!IMPORTANT]
>Changes made on a Domain Controller may take some time to replicate with other domain controllers in your network. You may need to log out and then log in using the service account (a stop/start operation may also do the trick).

First, issue the following command from an elevated command prompt on the Windows Server to update group policies:  

```powershell
gpupdate /force
```

:Nodinite: provides many applications and services that you can install on one or more Windows Servers, potentially with multiple [Environments][Environment]:

* [Core Services][], each an [IIS][] web site on Windows Server
* [Logging Agents][Logging]
* [Monitoring Agents][]

The :Nodinite: services above require different access rights on hosting Windows Servers and [SQL Server Databases][Microsoft SQL Server]. You choose the service identities in the :Nodinite: Portal, in the [Service Account Defaults][Step 2 Service Account Defaults] of the Auth step, per Core Service in the [Servers step][Step 4 Core platform services], and per agent in the [Agents step][Step 5 Agents]; the CLI then configures the [IIS][IISAuthIISIUSRS] application pools with those identities. Each identity still needs the Windows rights on this page.

>[!NOTE]
>On Windows Server, these Windows prerequisites apply to the :Nodinite: service identities: the **Log on as a service** right and IIS_IUSRS membership (this page; see the [Monitoring Service][Monitoring Service Windows rights] for an example), and a configured [MSDTC][Transactions MSDTC] when a [Log Database][Log Databases] is on another SQL Server instance. Network ports are listed on each component's Prerequisites page, for example the [Monitoring Service firewall settings][FW Monitoring Service Prerequisites].  

## :fa-user-secret: Stay secure with least privileges

We designed :Nodinite: [Monitoring Agents][] and services to run with minimum permissions (least privilege):

```mermaid
graph TB
    subgraph "Privilege Levels"
        direction TB
        LocalSystem["fa:fa-crown Local System<br/>Avoid - too privileged"]
        LocalAdmin["fa:fa-user-shield Local Administrator<br/>Some agents only"]
        DomainAccount["fa:fa-user-tie Domain Service Account or gMSA<br/>Recommended"]
        BuiltIn["fa:fa-user Built-in Accounts<br/>ApplicationPoolIdentity"]
    end
    subgraph "Required Rights"
        direction TB
        LogonService["fa:fa-key Logon as a Service"]
        SQLAccess["fa:fa-database SQL Server Access"]
        SPNReg["fa:fa-shield-halved SPN Registration"]
        FileAccess["fa:fa-folder File System Access"]
    end
    DomainAccount --> LogonService
    DomainAccount --> SQLAccess
    DomainAccount --> SPNReg
    DomainAccount --> FileAccess
    LocalAdmin --> LogonService
    LocalAdmin --> SQLAccess
    LocalAdmin --> FileAccess
    BuiltIn --> LogonService
    style LocalSystem fill:#c33d34,color:#fff
    style LocalAdmin fill:#FFD525
    style DomainAccount fill:#93d16d
    style BuiltIn fill:#93d16d
    style LogonService fill:#2678BD,color:#fff
    style SQLAccess fill:#2678BD,color:#fff
    style SPNReg fill:#2678BD,color:#fff
    style FileAccess fill:#2678BD,color:#fff
```

*Diagram: :Nodinite: service account privilege model. Green accounts (domain service accounts, [gMSA][], and built-in accounts) provide least-privilege access. Yellow accounts ([local administrator](#local-administrator)) only for specific [Monitoring Agents][]. Red accounts (Local System) should be avoided. The blue boxes are the rights each account needs: Logon as a Service, SQL Server access to the [Configuration Database][ConfigDB] and [Log Databases][], [SPN][] registration, and file system access.*  

* Each Windows Service can run with the same account, or you can use different accounts for each instance/service installed.  
  * Separate accounts increase security and allow fine-tuned access.  
* The [BizTalk][BizTalk Monitoring Agent] and [Windows Server][Windows Server Monitoring Agent] [Monitoring Agents][] require their account to be part of the [local administrators](#local-administrator) group; the other services and agents don't. Review the prerequisites page for each agent.  
* Some agent **service accounts** require interactive logon (e.g., agents that install or update their [Monitoring Agent Database][Agent Database]). The [Core Services][] don't; see [IIS Application Pool Identities](#iis-application-pool-identities).  
* Always use dedicated **service accounts**—never assign accounts used by physical persons.  
* **Custom domain accounts require [Service Principal Names (SPN)][SPN]** for Kerberos authentication in distributed environments or when NTLM is disabled.  
* Manage service account passwords as part of your policy and maintenance.  

>[!IMPORTANT]
>With :Nodinite: v7, you can change the service account password without losing access to encrypted secrets; changing the service **account** itself means moving the secret-encryption certificate. See [Service Account Password Changes][SecretManagementChange].

### Eliminate Password Expiration with gMSA Accounts

:Nodinite: v7 supports **Group Managed Service Accounts (gMSA)**: Active Directory handles password rotation automatically, and no administrator ever knows the password. The trade-off is that you provision the secret-encryption certificate yourself in the `LocalMachine` store, from your own PKI; see [Install Certificates for gMSA][].

A gMSA still needs the **Log on as a service** right described below. For the comparison with traditional accounts and the setup steps, see [Configure Group Managed Service Accounts (gMSA)][gMSA].

## What are the minimum user permissions required to install a Windows service?

You must be a [Local Administrator](#local-administrator) to run the :Nodinite: CLI ([Step 7: Run the CLI Workflow][Portal Run CLI]) and to install :Nodinite: Windows Services.

>Only processes with Administrative privileges can open handles to the SCM (Service Control Manager) that can be used by the CreateService and LockServiceDatabase functions (see the following MSDN '[Service Security and Access Rights' article](https://learn.microsoft.com/en-us/windows/win32/services/service-security-and-access-rights)<sup>:fa-arrow-up-right-from-square:</sup> for details).

## What are the minimum user permissions required to run a Windows service?

The minimum user permission required to **run** a Windows service is the **Log on as a service** right — one of the core Service Account rights — a **local policy** set by a [Local Administrator](#local-administrator) on the server or via group policy.

This security setting allows a security principal to **Log on as a service**. Windows Services can run under built-in accounts (Local System, Local Service, Network Service), which have this right by default. Any service running under a different user account must be assigned the **Log on as a service** right.

>[!IMPORTANT]
>The default setting in Windows is **None (!)**. This means that the account (even the [Local Administrator](#local-administrator)) must be assigned this right.

### How to add a service account to a local policy

1. Open the **Server Manager**, click **Tools**, and select **Local Security Policy**.  
2. In Local Security Policy, open **Local Policies** > **User Rights Assignment**.  
   ![Local Security Policy console with User Rights Assignment][png_LocalSecurityPolicy]  
   *Example of the Local Security Policy console, where the Log on as a service policy lives under User Rights Assignment.*  
3. Add the account to the policy **'Log on as a service'**. If the account is already in use, log on/restart to get the new privileges.  
   ![Adding a service account to the Log on as a service policy][png_LocalSecurityPolicy_AddUser]  
   *Example of adding the :Nodinite: service account; for a gMSA, include the trailing `$`.*  

### IIS Application Pool Identities {#iis-application-pool-identities}

On Windows Server, every :Nodinite: v7 [Core Service][Core Services] (the [Web Client][], [Web API][], [Log API][], [Logging Service][], [Monitoring Service][], and [MCP Server][MCP Endpoint]) runs as an IIS application pool identity. Give those identities the least privileges they need:

| Right | How the identity gets it | What you do |
| --- | --- | --- |
| **Log on as a service** | IIS adds the application pool identity to this policy itself when the worker process starts ([Microsoft](https://learn.microsoft.com/en-us/archive/blogs/asiatech/how-iis-interferes-in-group-policy-log-on-as-a-service)<sup>:fa-arrow-up-right-from-square:</sup>) | Nothing on the server. When a Group Policy defines **Log on as a service** for the server, its list replaces the local one, so add every pool identity (or the gMSA) to that Group Policy too |
| **Log on as a batch job** and **Impersonate a client after authentication** | Granted to the IIS_IUSRS group by default; IIS adds IIS_IUSRS to the worker process at run time ([Microsoft](https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/iis/www-administration-management/default-permissions-user-rights)<sup>:fa-arrow-up-right-from-square:</sup>) | Make the identity a member of the [IIS_IUSRS group][IISAuthIISIUSRS], as Microsoft recommends for a custom identity. IIS starts a worker process as a batch logon by default, so when a Group Policy defines **Log on as a batch job**, keep IIS_IUSRS in its list |
| **Allow log on locally** | Not needed for an application pool | Don't grant it to the Core Services identities |
| Membership in the local **Administrators** group | Not needed | Don't grant it. One exception: the [Event Log Alarm Plugin][] source below |

*Least privileges for the application pool identities of the Core Services on Windows Server.*

Two settings and one Windows object complete the least-privilege setup:

* **Load User Profile = True** on each application pool. The secret-encryption certificate lives in the identity's own `CurrentUser` store, which needs the profile ([Secret Management][SecretManagementChange]).
* **Write access to the service's own `appsettings.json`**. Each service rewrites its settings file with the protected values on start.
* **The Event Log source of the Event Log Alarm Plugin**. The plugin creates its source the first time it writes, and only a local administrator can create one. Create the source once as an administrator, or alarms through that plugin fail for a least-privilege identity.

Agents installed as Windows services are different: their identity still needs **Log on as a service** and **Allow log on locally**, and some agent identities, such as the BizTalk and Windows Server agents, must be local administrators; see each agent's prerequisites. In the container runtimes ([Runtime Environments][]), the Core Services run without IIS, so none of these Windows rights apply.

:Nodinite: Service Accounts are used for:

* [Monitoring Service][]—Shared or specific service identity  
  * Read/Write access to [Configuration Database][ConfigDB] and [Log Databases][]  
* [Logging Service][]—Shared or specific service identity  
  * Read/Write access to [Configuration Database][ConfigDB] and additional rights on [Log Databases][]  
* [Web Client][], [Web API][], [Log API][], and [MCP Server][MCP Endpoint]—Shared or specific service identity of the IIS web site  
* [Monitoring Agents][]—Shared or specific service identity; for some, also review the [Monitoring Agent Database][Agent Database]  
* [Logging Agents][Logging]—Shared or specific service identity; sometimes with 'Read/Write' access to the :Nodinite: [Configuration Database][ConfigDB]  

>[!IMPORTANT]
>When using **custom domain service accounts** (not built-in accounts like Network Service), you must register Service Principal Names (SPNs) for Kerberos authentication in distributed environments or when NTLM is disabled. SPNs are required in two distinct areas:
>
>* **SQL Server, linked servers, [Always On Availability Groups][]:** See [Service Principal Names (SPN)][SPN]
>* **IIS application pool account — Nodinite v7 Web Client:** See [Restoring Kerberos Transparent Login After Upgrading to v7][KerberosV7]
>
>**:Nodinite: v7 — pure Kerberos environments (NTLM disabled):** If NTLM is disabled organisation-wide, the v7 Web Client will **not** be operational unless HTTP SPNs are registered for the IIS application pool service account **and** `useAppPoolCredentials` is configured in IIS. The [SQL Server SPN][] guide alone does not cover this requirement.
>[!WARNING]
>**Windows Server Monitoring Agent - Additional Remote Monitoring Requirements**
>
>When the [Windows Server Monitoring Agent][WindowsServerAgent] monitors **remote** Windows Servers, the service account requires additional configuration beyond "Logon as a Service" rights:
>
>* Service account must be in the **local Administrators group** on **each remote server** being monitored
>* **UAC Remote Token Filtering** may block remote administrative access even when the account is in Administrators group
>* See [Prerequisites for Windows Server Monitoring Agent][WindowsServerPrerequisites] for complete requirements
>* See [How to Monitor Remote Scheduled Tasks][RemoteScheduledTasks] for UAC token filtering troubleshooting
>
>This additional requirement applies **only to the Windows Server Monitoring Agent** when monitoring remote servers, not to other :Nodinite: services or agents.
>[!TIP]
>Keep the **AppPool** accounts out of the [Local Administrator](#local-administrator) group: add them to the [IIS_IUSRS group][IISAuthIISIUSRS] instead, and make sure they have 'Read/Change/Write' permissions on all Web Application folders installed. See [IIS Application Pool Identities](#iis-application-pool-identities).

## Local Administrator

Follow these steps to add an account to the **Local Administrator group** on a Windows Server. Repeat on all servers hosting :Nodinite: [Monitoring Agents][] that require elevated privileges, such as the BizTalk and Windows Server agents. The [Core Services][] don't need it.

1. Open the **Server Manager**  
2. Click **Tools** in the right corner of Server Manager and select **Computer Management**  
   ![Computer Management][1]  
3. Expand **Local Users and Groups** and select **Groups**. Double-click on the **Administrators** group  
   ![Local Users and Groups][2]  
4. Add the AD service accounts that should be part of the highly privileged local Administrator's group  
   ![Administrators Properties][3]

### Add Service Account on Domain Controller

>[!NOTE]
>You need to be a member of the **Domain Admins** group to add AD accounts to the local Administrators group locally on the Domain Controller

If you need to work on the **Domain Controller**, you cannot find the **Local Users and Groups** in 'Computer Management'. To add any account to the local Administrator group on the domain controller, open **Active Directory Users and Computer** or use an **Administrative command prompt**:

```powershell
net localgroup Administrators /add {domain}\{user}
```

*Replace `{domain}\{user}` with the account to be added (without the brackets).*

>[!WARNING]
>Adding a service or user account to the local Administrators group grants the account permissions to make changes in your Active Directory environment, not just the local server

### Add Service Account on Read Only Domain Controller (RODC)

If your Domain Controller is installed as a [Read-Only Domain Controller](https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/deploy/rodc/install-a-windows-server-2012-active-directory-read-only-domain-controller--rodc---level-200-)<sup>:fa-arrow-up-right-from-square:</sup>, follow the [steps for delegating local administration on an RODC](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc755310%28v=ws.10%29?redirectedfrom=MSDN#delegating-local-administration-of-an-rodc)<sup>:fa-arrow-up-right-from-square:</sup> to add the service account(s) local admin rights.

## :fa-hand-point-right: Next Steps

* :fa-rocket: [Install Nodinite v7][InstallNodiniteV7]  
* :fa-arrows-rotate: [Update Nodinite v7][Updating Nodinite v7]  
* :fa-user-shield: [Configure Group Managed Service Accounts (gMSA)][gMSA]  

## :fa-link-horizontal: Related Topics

* :fa-globe: [Web Client][]  
* :fa-database: [Configuration Database][ConfigDB]  
* :fa-database: [Log Databases][]  
* :fa-key: [Service Principal Names (SPN)][SPN]  
* :fa-key: [Restoring Kerberos Transparent Login After Upgrading to v7][KerberosV7]  
* :fa-shield-halved: [Trusted for delegation][]  
* :fa-shuffle: [Transactions MSDTC][]  
* :fa-sign-in: [Why do Nodinite use port 8000][Port8000]  
* :fa-file-exclamation: [Troubleshooting][]  
* :fa-arrow-turn-up: [Windows Server Troubleshooting][Windows Overview]  
* :fa-clipboard-check: [Prerequisites for Installing Nodinite][Prerequisites]  

[1]:{ndm}/Documentation%20Pictures/IM/IMUpdate/Troubleshooting/ComputerMgmt.png
[2]:{ndm}/Documentation%20Pictures/IM/IMUpdate/Troubleshooting/LocalUsersAndGroups.png
[3]:{ndm}/Documentation%20Pictures/IM/IMUpdate/Troubleshooting/AdministratorsProperties.png

[Agent Database]:{ndr}/Install%20and%20Update/Troubleshooting/SQL%20Server/Agent%20Database.md
[Always On Availability Groups]:{ndr}/Install%20and%20Update/Troubleshooting/SQL%20Server/Always%20On%20Availability%20Groups.md
[BizTalk Monitoring Agent]:{ndr}/Logging%20and%20Monitoring/Microsoft%20BizTalk%20Server%20-%20Monitoring/Overview.md
[ConfigDB]:{ndr}/Core%20Services/Configuration%20Database/Overview.md
[Core Services]:{ndr}/Core%20Services/Overview.md
[Environment]:{ndr}/Getting%20Started/Menu%20-%20Environment.md
[Event Log Alarm Plugin]:{ndr}/Administration/5.%20Settings/1.%20Alarm%20Plugins/Features/Event%20Log.md
[FW Monitoring Service Prerequisites]:{ndr}/Core%20Services/Monitoring%20Service/Getting%20started/1.%20Prerequisites.md#fa-shield-check-what-firewall-settings-are-required-for-the-monitoring-service
[gMSA]:{ndr}/Install%20and%20Update/Troubleshooting/Windows/gMSA%20accounts.md
[IIS]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Features/IIS.md
[IISAuthIISIUSRS]:{ndr}/Install%20and%20Update/Troubleshooting/IIS/IIS%20Authentication%20settings.md#fa-users-cog-iis_iusrs-group-membership
[Install Certificates for gMSA]:{ndr}/Install%20and%20Update/Troubleshooting/Windows/Install%20Certificates%20for%20gMSA.md
[InstallNodiniteV7]:{ndr}/Install%20and%20Update/Getting%20started/Version%207/Install%20Nodinite%20v7.md
[KerberosV7]:{ndr}/Install%20and%20Update/Troubleshooting/IIS/Hardening/Kerberos%20Transparent%20Login%20After%20v7%20Upgrade.md
[Log API]:{ndr}/Core%20Services/Log%20API/Overview.md
[Log Databases]:{ndr}/Core%20Services/Log%20Databases/Overview.md
[Logging]:nodiniteDoc:/Logging
[Logging Service]:{ndr}/Core%20Services/Logging%20Service/Overview.md
[MCP Endpoint]:{ndr}/Core%20Services/MCP%20Endpoint/Overview.md
[Microsoft SQL Server]:{ndr}/Install%20and%20Update/Troubleshooting/SQL%20Server/SQL%20Server%20Options.md  
[Monitoring Agents]:{ndr}/Administration/2.%20Monitor%20Management/2.%20Monitor%20Agents/Features/What%20is%20a%20Monitor%20Agent.md
[Monitoring Service]:{ndr}/Core%20Services/Monitoring%20Service/Overview.md
[Monitoring Service Windows rights]:{ndr}/Core%20Services/Monitoring%20Service/Getting%20started/1.%20Prerequisites.md#what-windows-rights-does-the-monitoring-service-require
[png_LocalSecurityPolicy]:{ndm}/Documentation%20Pictures/IM/Common/LogonAsAService/LocalSecurityPolicy.png
[png_LocalSecurityPolicy_AddUser]:{ndm}/Documentation%20Pictures/IM/Common/LogonAsAService/LocalSecurityPolicy_AddUser.png
[Port8000]:{ndr}/Install%20and%20Update/Troubleshooting/Windows/Why%20do%20Nodinite%20use%20port%208000.md
[Portal Run CLI]:{ndr}/Install%20and%20Update/Getting%20started/Version%207/Install%20Nodinite%20v7%20Steps/07%20-%20Install%20the%20Generated%20Package.md
[Prerequisites]:{ndr}/Install%20and%20Update/Getting%20started/2.%20Prerequisites.md
[RemoteScheduledTasks]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Troubleshooting/How%20to%20Monitor%20Remote%20Scheduled%20Tasks.md
[Runtime Environments]:{ndr}/Install%20and%20Update/Troubleshooting/Runtime%20Environments/Overview.md
[SecretManagementChange]:{ndr}/Install%20and%20Update/Troubleshooting/Secret%20Managment.md#fa-key-service-account-password-changes-what-you-need-to-know
[SPN]:{ndr}/Install%20and%20Update/Troubleshooting/SQL%20Server/SPN.md
[SQL Server SPN]:{ndr}/Install%20and%20Update/Troubleshooting/SQL%20Server/SPN%20for%20SQL%20Server.md
[Step 2 Service Account Defaults]:{ndr}/Install%20and%20Update/Getting%20started/Version%207/Install%20Nodinite%20v7%20Steps/02%20-%20Auth.md#service-account-defaults
[Step 4 Core platform services]:{ndr}/Install%20and%20Update/Getting%20started/Version%207/Install%20Nodinite%20v7%20Steps/04%20-%20Servers.md#core-platform-services
[Step 5 Agents]:{ndr}/Install%20and%20Update/Getting%20started/Version%207/Install%20Nodinite%20v7%20Steps/05%20-%20Agents.md
[Transactions MSDTC]:{ndr}/Install%20and%20Update/Troubleshooting/Windows/Transactions%20MSDTC.md
[Troubleshooting]:{ndr}/Install%20and%20Update/Troubleshooting/Overview.md
[Trusted for delegation]:{ndr}/Install%20and%20Update/Troubleshooting/Windows/Trusted%20for%20delegation.md
[Updating Nodinite v7]:{ndr}/Install%20and%20Update/Getting%20started/Version%207/Updating%20Nodinite%20v7.md
[Web API]:{ndr}/Core%20Services/Web%20API/Overview.md
[Web Client]:{ndr}/Getting%20Started/Overview.md
[Windows Overview]:{ndr}/Install%20and%20Update/Troubleshooting/Windows/Overview.md
[Windows Server Monitoring Agent]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Overview.md
[WindowsServerAgent]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Overview.md
[WindowsServerPrerequisites]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Getting%20started/1.%20Prerequisites.md