Skip to main content
Joinly by KoppelHet

User provisioning and lifecycle

Managing service accounts: every technical account an owner, a reason and an end date

A service account runs a service, an integration or a script, and is not in HR. That is why it never leaves, and after a few years nobody knows what it is for. Give every technical account an owner, a reason and an end date, choose a type whose password is managed for you where possible, and find the accounts that already exist.

Choose the safest type of account for each service

A service account is an account that is not a person: it starts a Windows service, signs an integration in to an application or runs a script that fetches data at night. In an organisation with on-premises Active Directory and Microsoft 365 there are two families, and Microsoft has a clear preference within each.

The types, from most to least recommended
TypeWhereWhen
Group managed service account (gMSA)Active DirectoryThe first choice for on-premises services, also when they run on several servers. Windows manages the password.
Standalone managed service account (sMSA)Active DirectoryIf a gMSA is not possible. Works on one server.
Computer accountActive DirectoryIf a managed account is not possible. Drawback: you cannot see which service on that computer uses the account.
Managed identityEntra IDFor services that run in Azure. There is no password or secret to manage.
Service principalEntra IDFor services outside Azure, or if a managed identity is not possible. Preferably with a certificate instead of a client secret.
Ordinary user accountAD or Entra IDThe last resort. Microsoft advises against it, and yet you come across it in almost every environment.

A user account as a service account is so common because it always works: the vendor of an application asks for "an account with these permissions", and that is quickly made. The drawback is that such an account looks like an employee, behaves like one for every policy, and has a password someone has to manage by hand.

Why service accounts linger

Employee accounts follow HR: whoever leaves disappears from payroll, and with that usually from Entra ID as well. A service account has no such moment. It stays until someone decides it can go, and nobody dares to take that decision.

  • It was created for a project. The implementation is finished, the vendor has gone, the account is still there.
  • The creator has left. Whoever created the account knew what it was for. That knowledge left with them.
  • Nobody dares to disable it. Something might still run on it. So it stays enabled, with all its permissions.
  • The password never expires. Otherwise the integration would stop. The same password then sits in a configuration file for years.
  • It has too many permissions. It did not work during installation, so it was made a member of an admin group. That was never undone.

That makes service accounts attractive to an attacker: many permissions, a password that does not change, and nobody who notices when the account suddenly signs in at a different time. You see the same pattern with contractors and guest accounts.

Record per account who owns it, why it exists and until when

Microsoft names six things to document per service account. Together they answer the question that comes back in every audit: whose is this, and why does it still exist?

WhatWhat you fill inWhy
OwnerOne person who is accountable for itSomeone has to say yes to extending and to cleaning up
PurposeThe application or integration it is forWithout a purpose you can never decide that it can go
PermissionsWhich permissions and groups it has, and which it needsYou clean up the difference between them
RiskWhat happens if the account is misusedHigh risk: choose a managed account or restrict it further
LifetimeAn end date, and how often the owner confirms it is still neededThat way the account comes back on the table by itself
PasswordWhere it is stored and who can get to itFor a user or local account that is your responsibility

Also make the account recognisable. Microsoft recommends a prefix, such as svc- (for example svc-HRDataConnector), and the owner in the description attribute. Use one account per service, so you can see in the logs which service did something and can disable one integration without affecting the rest. How to set up naming further is covered in username and email address.

Passwords and MFA exceptions under control

The hardest part of a service account is the way it signs in. A person can approve an MFA prompt, a script cannot. That is why service accounts so often get an exception: password never expires, no MFA. Those exceptions are sometimes necessary. Things go wrong when nobody remembers they exist.

  • Let the password be managed where possible. With a gMSA, Windows manages the password. With a managed identity there is no secret. Every account you can create this way is one password fewer in a configuration file.
  • Choose a certificate for a service principal. A client secret easily ends up in code or a script; according to Microsoft a certificate cannot accidentally end up there.
  • Change passwords you manage yourself according to an agreement. Record who does it and coordinate it with the application, so the integration does not stop.
  • Make every exception a decision. An MFA exception or a password that does not expire gets an owner, a reason and an end date, just like the account itself.
  • Limit what the account can do. Take it out of admin groups and give only the permissions the service needs. An account that does not need to sign in interactively should not be allowed to.

For Azure and the Microsoft admin centres, Microsoft has already made part of the choice. Anyone who signs in to the Azure portal, the Entra admin center, the Intune admin center or the Microsoft 365 admin center, and anyone who performs management actions with Azure CLI, Azure PowerShell or the REST API, must use MFA. That also applies to a user account that runs a script, and an exclusion in Conditional Access does not help there. Managed identities and service principals are not affected. Microsoft recommends converting such user accounts to one of those two. According to Microsoft, the synchronisation account of Entra Connect and Cloud Sync is not affected.

Finding the service accounts that already exist

A new policy only helps for new accounts. The accounts that carry risk today already exist. A user account has no property that says it is a service account, so you search on the characteristics they often have. Microsoft gives three, with these commands:

User accounts in AD that are often a service account
# Accounts with a service principal name
Get-ADUser -Filter * -Properties servicePrincipalName | where {$_.servicePrincipalName -ne $null}

# Accounts with a password that never expires
Get-ADUser -Filter * -Properties PasswordNeverExpires | where {$_.PasswordNeverExpires -eq $true}

# Accounts trusted for delegation
Get-ADObject -Filter {(msDS-AllowedToDelegateTo -like '*') -or (UserAccountControl -band 0x0080000) -or (UserAccountControl -band 0x1000000)} -prop samAccountName,msDS-AllowedToDelegateTo,servicePrincipalName,userAccountControl | select DistinguishedName,ObjectClass,samAccountName,servicePrincipalName

Those searches do not find everything. The most reliable comparison is the one with HR: every account in AD and Entra ID that does not belong to an employee in service belongs to someone who has left, to an external, or to no person at all. That last group is your list of technical accounts.

  1. Make the list. Put all accounts next to HR and keep the accounts that no employee belongs to.
  2. Find an owner for each account. Look at the name, the description, the groups and when it last signed in. Check with the application manager.
  3. Record purpose and end date. Whatever nobody claims gets a short end date instead of eternal life.
  4. Disable before you delete. First disable an account without an owner and wait an agreed period. If something stops, you immediately know what it was for and who becomes the owner.
  5. Only delete after that, and record who decided.

Joinly

Technical accounts in the same lifecycle as your employees

A spreadsheet with owners and end dates is a good start, until the first owner leaves or the first end date passes unnoticed. What you need is a place where technical accounts get the same rules as employees.

In Joinly an identity is a person or a technical account. Joinly retrieves the existing accounts from Entra ID and Active Directory and puts them next to HR, without changing anything; the accounts that no person belongs to then stand out by themselves. A service account gets a type of its own, an accountable person, a reason and an end date. The status is derived live, and accounts that need attention go onto a work queue. As the end date approaches, the account is reviewed again. On the end date it is closed, sessions are revoked and licences are freed up. Everything is in the same audit log as your employees.

At the start Joinly works with a trial import: you see in advance which accounts would be created, changed or blocked when the integration goes live, and go through it as an Excel file before anything changes. That way you see an account that would be closed before it happens. Admin accounts are in the same overview, with the same rules, and contractors, guest accounts and interns are handled in the same way.

Het auditlog in Joinly: elke wijziging aan identiteiten en toegang, met wie het deed en waaromSee identity lifecycle management

What you can count on

  • No vendor lock-inYour identities and your configuration stay yours.
  • Your data out whenever you wantYou can export your data at any time.
  • Standard SLAOur standard SLA is available on request.
  • Support during implementationOur specialists set it up together with you.
  • ISO 27001 certifiedInformation security to an internationally recognised standard.

Managing service accounts

Frequently asked questions

  • What is a service account?

    An account that is not a person: it starts a service, signs an integration in or runs a script. In Active Directory that is a gMSA, sMSA, computer account or user account; in Entra ID a managed identity, service principal or user account.

  • What is the difference between a gMSA and an ordinary service account?

    With a group managed service account (gMSA), Windows manages the password, also when the service runs on several servers. With an ordinary user account an administrator has to manage and change the password themselves. Microsoft recommends a gMSA wherever the service supports it.

  • Does a service account need to use MFA?

    For signing in to the Azure portal and the Microsoft admin centres, and for management actions with Azure CLI, Azure PowerShell or the REST API, Microsoft requires MFA, also from a user account that runs a script. Managed identities and service principals are outside this. Microsoft therefore recommends converting user accounts used for automation to one of those two.

  • How do you find service accounts in Active Directory?

    Search for accounts with a service principal name, with a password that never expires and that are trusted for delegation. In addition, put all accounts next to HR: whatever does not belong to an employee is often a technical account.

  • Who is the owner of a service account?

    A person who is accountable for the account: usually the manager of the application or integration it exists for. If that person leaves, assign a new owner before they have gone.

  • Can you simply delete a service account without an owner?

    Disable it first and wait an agreed period. If something stops, you know what it was for and who becomes the owner. If nothing happens, delete it and record who decided.

Let accounts move along by themselves

Joiners, movers and leavers from HR, with every step in the audit log. Start with demo data in the free trial environment.

No credit card, nothing to install.

Rather talk to someone first? Talk to an IAM specialist