logo

What are Active Directory Service Accounts?

Just like human users, computer programs also need access to resources on a network to function properly. There’s a difference in how these two groups—individuals and programs—access these resources, though. While humans utilize user accounts, computer programs use Active Directory service accounts. Active Directory service accounts allow computer services and programs to run without the need for human intervention, which is essential for ensuring that critical processes run uninterrupted behind the scenes. Nonetheless, like user accounts, you still need to manage Active Directory service accounts lest they expose your organization to cyber attacks. 

This guide will explore everything related to Active Directory service accounts — from understanding their importance to the different types of AD service accounts, to how to manage them.

Understanding Service Accounts

A service account is a type of privileged account that allows applications or services to interact with the operating system and other network resources. These non-human accounts work by assigning identities and permissions (privileges) to computer programs and services that try to access system resources, just like user accounts. Generally, there are several types of service accounts, including Managed Service Accounts, Group Managed Service Accounts, Local Service Accounts, and others, but more on this later on in the guide. 

Discover more about service accounts in the following posts:

Differences between user accounts and service accounts

The first and main difference between user accounts and service accounts is how they’re created. While user accounts require a network administrator to create and assign privileges, most (not all—some can be manually created) come pre-installed and configured as part of the service or software.

Another key difference lies in how they run and can be identified. With user accounts, you can identify the individual tied to a specific account because they’re designed to allow humans to access system resources. On the other hand, service accounts aren’t associated with a specific person because they’re created for non-human entities like applications or services. 

Because of how they run and their roles in an Active Directory environment, user accounts and service accounts also differ in their authentication. While user accounts require manual logins via user IDs and passwords, service accounts operate autonomously, so they don’t require permissions to run services.

Importance of Service Accounts

Service accounts are extremely important, especially in enterprise environments, for several reasons. But perhaps the most important reason is the role they play in facilitating the smooth operation of critical processes. Service accounts automate essential (and sometimes repetitive) tasks, like running backups, managing databases, and system updates. This way, enterprises can reduce administrative overhead, increase efficiency, and scale up and down as needed.

Service accounts can also act as proxies for human users to perform tasks that your enterprise might consider sensitive or require elevated permissions. This is vital for maintaining network security. By eliminating the human element from such tasks, your organization can protect its network from security-related incidents because only authorized services and applications can perform certain tasks. 

Some common examples of services and applications that use service accounts include:

Types of Service Accounts in Active Directory

Let’s now explore the different types of AD service accounts in detail, including their use cases:

Local Service Accounts

A (built-in local) user account is a type of Active Directory service account that automatically gets created on a machine or individual server during installation. These service accounts are not usually part of any domain and, thus, are typically used for services that only need access to local resources. 

The most common examples of local user accounts that applications can run under are the Local System account (or System Account), Local Service account, and Network Service Account. 

Domain Service Accounts

These AD service accounts are commonly used and ideal for services that require access to shared resources, such as databases or file servers. They’re created within Active Directory to facilitate access to resources across the network by services or applications. 

Managed Service Accounts (MSAs)

Also known as Standalone Managed Service Accounts (sMSA), Windows Managed Service Accounts (MSAs) are newer account types that Microsoft introduced in Windows Server 2008 R2 or Windows 7. These accounts are similar to domain accounts but with a major improvement—passwords are automatically managed and reset every 30 days. This improvement eliminates the need for an administrator to manage passwords, thus improving security. 

Apart from security, AD managed service accounts provide other administrative benefits, including:

  • You don’t need to manage service principal names (SPNs) as with local user accounts.
  • You don’t have to reset passwords for these accounts manually.
  • You can create domain accounts that facilitate the management of services on local machines. 

How to Create and Manage MSAs:

Before creating an MSA account, you must meet several prerequisites, including:

  • Windows Server 2008 R2 or Windows 7
  • Run ADPrep|Forest Prep
  • Net Framework 3.5
  • Active Directory module for Windows PowerShell

Once you meet the above prerequisites, follow the steps outlined below:

  1. Click the Start menu and open PowerShell. 
  2. In the PowerShell console, run the command “Import-module ActiveDirectory” to import the Active Directory module. 
  3. Next, run the command “New-ADService Account -Name <AccountName> -enable $true” Replace <AccountName> with your desired account name.
  4. This step involves associating the MSA with the computer that will run the service. To do this, run the  command “Add-ADComputerServiceAccount -Identity <ComputerName> -ServiceAccount <AccountName>
  5. Run the command “Install-ADServiceAccount -Identity <AccountName>” to install the MSA on the computer and make it available for use.
  6. Finally, configure the service to use the MSA for authentication. In the service’s properties, specify the MSA as the account under the “Log On” tab. Use the format “DOMAIN\<AccountName>$” when entering the MSA name.

Group Managed Service Accounts (gMSAs)

These service accounts are an extension of Managed Service Accounts—they support the same functionalities but extend them to multiple servers. Additionally, gMSAs are only supported by Windows Server 2012 or later. 

How to Create and Manage gMSAs

You don’t have to meet any functional level or domain requirements to create gMSAs. 

  1. Create the KDS root by running the command “Add-KdsRootKey -EffectiveTime ((Get-Date).AddHours(-10))” on the Active Directory PowerShell module.
  2. Open Powershell and run the following command to import the Active Directory module: “Import-Module ActiveDirectory
  3. Run the following command :”New-ADServiceAccount -Name <AccountName> -DNSHostName <DNSHostName> -PrincipalsAllowedToRetrieveManagedPassword "<GroupName>” to create the gMSA. 

“AccountName” in this case will be the name of the gMSA, while “DNSHostName” is the name of the domain controller, and “GroupName” is the group or computer objects allowed to retrieve the gMSA password.

  1. Install the account on each server that will use the gMSA by running the command, “Install-ADServiceAccount
  2. To verify that you’ve installed the gMSA and it’s functioning correctly on each server, use the following command: “Test-ADServiceAccount <AccountName>” 

If you see the result is true, you have properly installed the gMSA and it’s ready for use. To use the gMSA for a service, open the service’s properties and navigate to the “Log On” tab. Specify the gMSA as the account using the format “DOMAIN\<AccountName>$”

Common Challenges and How to Overcome Them

Managing AD service accounts is not without its fair share of challenges. In this section, we explore what you should expect to face when dealing with service accounts and how to deal with these challenges by incorporating best practices that keep service accounts secure and running as they should. 

Password Management Issues

One of the most common challenge associated with Active Directory service accounts is the lack of password management. Unlike user accounts, service accounts rarely go through management practices like password rotation where you constantly change or reset your passwords after a certain period. The reason why your IT team might be overlooking this is not because they’re careless: quite far from it, actually. It’s because they fear the likely consequence of changing service accounts’ passwords, which is disrupting critical processes.

Auditing and Monitoring Service Account Usage

Monitoring and auditing service accounts pose a huge challenge for IT administrators. There are several reasons for this. For one, the number of service accounts in a single enterprise can be incredibly high that it becomes impossible to keep up. While you may be able to monitor some of these accounts, others may fall through the cracks because you simply don’t know they exist. Moreover, accountability can become an issue because these accounts are inherently not attached to a specific user.

Service Account Security

As with most AD accounts, security remains a challenge for service accounts. Most service accounts have high privileges and permissions, so if a security breach were to occur, they would have access to so many resources across your organization’s network. Additionally, if you have too many service accounts that are unaccounted for, securing each and every single one may be impossible. 

Orphaned or Unused Service Accounts

Left unchecked, your enterprise may be among the many organizations that have so many service accounts that you simply can’t keep track of them. This may occur if employees managing these accounts leave your organization, if you migrate to new systems, or if you forget to remove temporary service accounts. These service accounts often go unnoticed and can end up accumulating on your network. 

Best Practices for Managing Service Accounts

There are several best practices you can implement to prevent and deal with the challenges discussed above. Some of these best practices include: 

  • Principle of Least Privilege (PoLP): This simply means granting service accounts only the (minimum) required permissions to perform the tasks they’re required to do. This best practice minimizes the risk of unauthorized actions and access. Additionally, in the case that a security breach occurs, the amount of damage the unauthorized user can cause is reduced.
  • Regularly Review and Update Permissions: On top of implementing PoLP, you should occasionally revise the permissions that each service account holds. This is because, over time, permissions may change for different applications and services, and you should ensure that they don’t have more access than necessary. 
  • Implement Strong Password Policies: For service accounts that don’t automatically change passwords like traditional domain accounts, strong password policies like using complex and long passwords, regularly changing passwords for service accounts with high privileges, and safely storing passwords can help reduce the possibility of breaches. 
  • Use MSAs and gMSAs to Reduce Administrative Overhead: MSAs and gMSAs automate password management and simplify SPN configuration. This frees up IT staff’s time to focus on other important tasks.
  • Monitor and Audit Service Account Activities: Creating service accounts and forgetting about them is a recipe for disaster (i.e. a security breach). As such, you must implement policies for conducting regular audits on accounts to detect and stop suspicious behavior.

Cleaning Up Unused Service Accounts

Unused service accounts can present security problems for your organization. As already established, some of these accounts may have very high privileges, so if an attacker gained access to one of them, they can do extensive damage. Identifying unused or orphaned service accounts is crucial. There are several ways you can do this, including: 

  • Using Privileged Access Management (PAM) Solutions: You can leverage solutions like Netwrix that scan your entire IT environment to discover all existing service accounts. From the list of accounts, you can find any unused and unnecessary accounts and remove them.
  • Leverage Search Queries: You can use a common query, “Service Accounts not logged in for $days” to identify old service accounts that aren’t used within your AD environment. 

Steps for safely removing unused service accounts

Removing old and unused accounts requires that you follow several steps to ensure that you don’t compromise the entire system. That said, after you’ve identified unused service accounts:

  1. Verify that the identified accounts are no longer needed. To do this, you can use the following PowerShell command: “Get-ADUser -Identity <AccountName> -Properties LastLogonDate”
  2. Instead of immediately deleting the service account, it’s advisable to disable it first. This allows you to verify that disabling the account does not affect any critical services.
  3. Once you have confirmed that disabling the service account will not cause any issues, you can delete it by running the following PowerShell command: “Remove-ADUser -Identity <AccountName>”

Tools and Techniques for Managing Service Accounts

PowerShell has proven to be a powerful tool for managing service accounts in your AD environment. It provides several commands that you can use to create, modify, and delete accounts easily and quickly. You can also use it to manage permissions and automate routine tasks. 

How Netwrix Can Help

Active Directory service accounts, while useful, can also pose security risks for your entire organization if not properly managed. That’s why relying on a solution that can help you create, manage, and maintain AD service accounts best practices is essential. At Netwrix, Active Directory is our specialty, so you can count on us to keep your service accounts secure. Our end-to-end Active Directory Security Solution works by performing risk assessments, implementing safeguards to protect your AD environment, responding to threats immediately, and supporting comprehensive AD recovery. 

FAQ

How to create a service account in Active Directory?

Creating a service account in Active Directory is straightforward, but doing it securely requires following proven best practices. Start by opening Active Directory Users and Computers (ADUC), navigate to the organizational unit where you want to create the account, and right-click to select “New” > “User.” Use a descriptive name that clearly identifies the service and purpose, such as “SQL-Service-Account” or “Backup-Service-Account.”

Set a strong, complex password that meets your organization’s policy requirements. Check the “Password never expires” option only if you have a robust password rotation process in place—otherwise, you’re creating a security risk. Configure the account with the minimum permissions needed for the specific service. This is where least privilege becomes practical, not theoretical. Assign the account to appropriate security groups based on service requirements, but never add it to privileged groups unless absolutely necessary.

Remember: attackers are logging in, not just breaking in. A poorly configured service account with excessive privileges becomes a highway for lateral movement. Data security that starts with identity means treating service accounts as critical security assets, not just functional necessities.

What is a service account in Active Directory?

A service account in Active Directory is a specialized user account designed to run services, applications, and automated processes—not for interactive user logons. Unlike regular user accounts, service accounts provide security context for applications and services that need to authenticate and access network resources without human intervention.

Service accounts come in four main types: Local Service Accounts run with limited privileges on the local machine; Domain Service Accounts can access network resources across the domain; Managed Service Accounts (MSA) offer automatic password management; and Group Managed Service Accounts (gMSA) extend MSA functionality to multiple servers. Each type serves different security and operational needs.

The key difference between service accounts and user accounts lies in their purpose and management. Service accounts run continuously in the background, require different security considerations, and often need specific permissions to system resources that regular users don’t need. They’re essential for maintaining least privilege principles while ensuring services function properly. When configured correctly, service accounts provide necessary access without compromising your security posture.

How to find service accounts in Active Directory using PowerShell?

PowerShell gives you powerful tools to identify and audit service accounts across your Active Directory environment. The most effective approach combines multiple commands to get comprehensive visibility into your service account landscape.

Start with this foundational command:

Get-ADUser -Filter {servicePrincipalName -like "*"} -Properties servicePrincipalName, lastLogon, passwordLastSet | Select-Object Name, servicePrincipalName, lastLogon, passwordLastSet

This identifies accounts with Service Principal Names (SPNs), which are typically associated with services.

For a broader search that includes accounts without SPNs, use:

Get-ADUser -Filter {Name -like "*service*" -or Name -like "*svc*" -or Description -like "*service*"} -Properties Description, lastLogon, passwordLastSet, memberOf | Select-Object Name, Description, lastLogon, passwordLastSet, memberOf

This catches accounts based on naming conventions and descriptions.

To identify potentially risky service accounts, run:

Get-ADUser -Filter {PasswordNeverExpires -eq $true -and Enabled -eq $true} -Properties passwordLastSet, lastLogon, memberOf | Where-Object {$_.memberOf -like "*Admin*"}

This finds enabled accounts with non-expiring passwords that have administrative privileges—exactly the type of accounts that need extra scrutiny.

Regular auditing with these PowerShell commands helps you spot risky behavior before it turns into a breach. You can’t manage what you can’t see—these commands give you the visibility needed to maintain proper service account hygiene.

How to create a managed service account in Active Directory?

Managed Service Accounts (MSAs) represent a significant security improvement over traditional service accounts by automating password management and eliminating password-related service outages. Creating an MSA requires preparation but delivers enhanced security with reduced administrative overhead.

First, verify your environment meets these prerequisites:

  • Windows Server 2008 R2 or later domain functional level
  • Service will run on Windows Server 2008 R2 or later
  • Active Directory module for PowerShell installed on your domain controller

Create the MSA using PowerShell:

New-ADServiceAccount -Name "MyServiceMSA" -DNSHostName "server.domain.com" -Enabled $true

Replace “MyServiceMSA” with your desired account name and “server.domain.com” with the fully qualified domain name of the server that will use this account.

Next, install the MSA on the target server by running this command from an elevated PowerShell session:

Install-ADServiceAccount -Identity "MyServiceMSA"

Test the installation to ensure everything is configured correctly:

Test-ADServiceAccount -Identity "MyServiceMSA"

Finally, configure your service to use the MSA by setting the service logon account to “Domain\MyServiceMSA$” (note the dollar sign) with no password. The system handles password management automatically, rotating it every 30 days by default. This approach stops checking boxes and starts securing identities with practical, automated solutions that reduce both risk and administrative burden.

Service account vs user account – when to use which?

The choice between service accounts and user accounts comes down to purpose, security requirements, and operational needs. Understanding when to use each type is crucial for maintaining security hygiene and operational efficiency.

Use service accounts for automated processes, services, applications, or scheduled tasks that operate independently of human interaction. These accounts handle non-interactive logons and require consistent, always-available access to specific resources. Service accounts excel in scenarios like:

  • Database services
  • Web applications
  • Backup processes
  • Monitoring tools
  • Integration services that authenticate across systems

User accounts are for human users who need interactive access to systems and applications. They handle variable usage patterns, temporary access needs, and scenarios where accountability and audit trails must connect to specific individuals. Use user accounts when a person needs to:

  • Log in interactively
  • Access email
  • Use applications interactively
  • Perform administrative tasks requiring human judgment

From a security perspective, service accounts should follow least privilege principles more strictly since they often run with elevated permissions and operate continuously. They need different monitoring approaches—unusual activity patterns may indicate compromise rather than normal usage variations. User accounts require different controls like multi-factor authentication, conditional access policies, and regular access reviews.

The key principle is purpose alignment: service accounts for services, user accounts for users. Mixing these purposes creates security gaps and operational complexity. Data security that starts with identity means using the right account type for the right purpose, with appropriate controls for each. This approach reduces your attack surface while maintaining operational efficiency.

Dirk Schrader is a Resident CISO (EMEA) and VP of Security Research at Netwrix. A 25-year veteran in IT security with certifications as CISSP (ISC²) and CISM (ISACA), he works to advance cyber resilience as a modern approach to tackling cyber threats. Dirk has worked on cybersecurity projects around the globe, starting in technical and support roles at the beginning of his career and then moving into sales, marketing and product management positions at both large multinational corporations and small startups. He has published numerous articles about the need to address change and vulnerability management to achieve cyber resilience.