Orphaned accounts are identities that still work but no longer have a current, accountable owner. They are left behind when employees leave, contractors finish, projects end or an application is retired while its service account keeps its password.
This guide explains why these leftovers are a reliable entry point for intruders, how to find them across directories, SaaS and cloud platforms, how to remove them safely, and how to build a process that stops new ones from piling up.
The examples are written for identity engineers, SOC analysts and the security leaders who have to report on identity hygiene.
Where a query or runbook is included, treat it as a starting point to adapt to your own tenant and log retention.
What orphaned accounts are, and how they differ from dormant accounts
The terms are often used interchangeably, but separating them makes remediation easier.
An orphaned account has lost its link to a responsible person or system: the owner left, changed roles, or the application it served no longer exists.
A dormant account has simply not authenticated for a defined period. Many accounts are both, but an orphan can still be active (a former employee’s credentials being used) and a dormant account can be perfectly legitimate (a break-glass admin that should rarely sign in).
Human identities
Typical human orphans include leavers whose directory object was never disabled, contractors created outside the HR system, duplicate accounts from mergers, and local accounts on network devices or databases that sit outside single sign-on.
Role changes cause a quieter variant: the person still works for you, but the second account they used in a previous job was never retired.
Non-human identities
Service accounts, API keys, OAuth applications, cloud IAM roles, CI/CD tokens and workload identities usually outnumber people by a wide margin, and they rarely have an HR record to trigger removal.
When the engineer who created a service principal leaves, nothing in the joiner-mover-leaver process notices.
These identities often hold broad permissions and are excluded from MFA by design, which makes them attractive to attackers.
Why forgotten accounts lead to breaches
An attacker who logs in with a valid account avoids most exploit detection, and an account nobody uses is one nobody will notice being used.
MITRE ATT&CK tracks this as Valid Accounts (T1078), with sub-techniques for default, domain, local and cloud accounts.
Its Valid Accounts: Local Accounts (T1078.003) entry notes that APT29 targets dormant or inactive user accounts and lists removing inactive or unused accounts as a mitigation.
The wider data supports the concern. In the 2025 Verizon Data Breach Investigations Report, credential abuse was the most common initial access vector at 22% of breaches, and third-party involvement doubled to 30% (Verizon, 2025).
Orphaned contractor and partner accounts sit at the meeting point of those two trends.
Three documented cases
- State government network (2024). A joint CISA and MS-ISAC advisory AA24-046A describes an intruder who logged in over VPN with a former employee’s administrator account that was not disabled after the employee left. Credentials found on a SharePoint server then gave access to a domain admin account synced to Azure AD. Neither account had MFA (CISA, 2024).
- Microsoft corporate tenant (2024). Microsoft reported that Midnight Blizzard password-sprayed a legacy, non-production test tenant account without MFA, then abused a legacy test OAuth application that still held elevated access to the corporate environment (Microsoft, 2024). The forgotten application was as important as the forgotten user.
- Colonial Pipeline (2021). Investigators reported that the ransomware operators entered through a VPN account that was no longer active but could still be used for remote access and did not have two-step verification (GovInfoSecurity, 2021).
In each case the failure was not a missing product. It was a missing owner and a missing review. That is also why identity attacks remain a steady news topic, from hijacked Teams accounts used to deliver malware to VPN appliance attacks that end in credential theft.
Where ownerless identities hide in large organizations
Size multiplies the problem because identity data is spread over many systems with different owners. Common hiding places include:
- Directory gaps: on-premises Active Directory objects that never synced to the cloud, or cloud-only accounts created by an admin outside provisioning.
- SaaS applications without SCIM: tools bought by a business unit with local logins that HR offboarding never touches.
- Infrastructure local accounts: firewalls, hypervisors, databases and appliances with their own user stores.
- Cloud IAM: access keys on IAM users, unused roles with trust relationships to external accounts, and service principals with expired owners.
- Developer platforms: personal access tokens, deploy keys and CI secrets created by people who have since left.
- Mergers and acquisitions: whole forests or tenants that were connected by trust and never fully absorbed.
Public-facing products add a further category. A flaw such as the Zoom Workplace account takeover issue shows how quickly any reachable account becomes a target, and stale accounts are the least likely to be patched, monitored or protected by modern authentication.
How to discover orphaned accounts
Discovery is a correlation exercise. You compare every account you can enumerate against an authoritative source of who should exist, and you flag anything that cannot be matched to an active owner or that has not been used within your threshold.
Step 1: Build the authoritative source
For people, the source is the HR system plus a contractor register with end dates. For machines, it is a service account inventory that records owner, purpose and review date.
CIS Controls v8 Control 5 asks for exactly this: an inventory of all accounts validated at least quarterly (Safeguard 5.1) and a separate inventory of service accounts with department owner, review date and purpose (Safeguard 5.5).
Step 2: Pull last-use data from every identity store
For Active Directory, the replicated lastLogonTimestamp attribute is accurate to within roughly two weeks, which is fine for a 45-day threshold.
The following PowerShell lists enabled user accounts with no logon in 45 days, along with fields useful for owner lookup.
# Illustrative: enabled AD users inactive for 45+ days
Import-Module ActiveDirectory
Search-ADAccount -AccountInactive -TimeSpan 45.00:00:00 -UsersOnly |
Where-Object { $_.Enabled } |
Get-ADUser -Properties lastLogonTimestamp, manager, department, whenCreated, description |
Select-Object SamAccountName, Department, Manager, whenCreated,
@{n=’LastLogon’;e={[DateTime]::FromFileTime($_.lastLogonTimestamp)}}, Description |
Export-Csv .\inactive-users.csv -NoTypeInformation
Run the same logic against Entra ID sign-in activity, Okta or your other identity provider, cloud IAM credential reports, and SaaS admin exports.
Accounts that have never signed in at all deserve their own list, since they often come from provisioning mistakes.
Step 3: Correlate and classify
Join the exports to HR and the service account inventory on employee ID, not display name. Every account should land in one of four buckets: matched and active, matched but dormant, unmatched (orphan), or non-human without an owner.
The last two are your immediate work queue.
Detecting orphaned account abuse in the SOC
Cleanup takes time, so the SOC needs detections that fire when a dormant identity wakes up. The highest-value signal is a successful sign-in from an account whose previous sign-in was long ago, especially from a new IP range, a VPN or an unusual application.
The KQL below is an illustrative Microsoft Sentinel hunting query for Entra ID sign-in logs. It needs at least 90 days of retention to be useful; tune the gap and add your break-glass accounts to an allowlist.
// Illustrative: successful sign-ins after 45+ days of inactivity
SigninLogs
| where TimeGenerated > ago(90d) and ResultType == “0”
| project UserPrincipalName, TimeGenerated, IPAddress, AppDisplayName, Location
| sort by UserPrincipalName asc, TimeGenerated asc
| extend PrevUser = prev(UserPrincipalName), PrevSignIn = prev(TimeGenerated)
| where UserPrincipalName == PrevUser and TimeGenerated – PrevSignIn > 45d
| extend DaysDormant = datetime_diff(‘day’, TimeGenerated, PrevSignIn)
| project UserPrincipalName, TimeGenerated, DaysDormant, IPAddress, AppDisplayName, Location
Pair it with a few related detections:
- Sign-ins by accounts whose HR status is terminated (requires an HR feed into your SIEM watchlist).
- Service accounts authenticating interactively or from hosts outside their documented systems.
- New credentials, secrets or consent grants added to old OAuth applications (ATT&CK T1098, Account Manipulation).
- Password spray patterns against legacy or test tenants, which Midnight Blizzard used precisely because they were less watched.
Keep your monitoring platform patched as well. Recent Splunk Enterprise flaws that enabled credential theft are a reminder that the tools holding your identity telemetry are targets too.
A safe deprovisioning workflow
Deleting accounts on day one causes outages, especially for service accounts nobody fully understands. A staged workflow removes risk quickly while leaving room to recover.
- Contain. Disable interactive sign-in, revoke refresh tokens and sessions, and remove the account from privileged groups. For non-human identities, rotate or revoke keys and secrets rather than only disabling the object.
- Tag and notify. Mark the object with a ticket number and date in a description or extension attribute, and send a notice to the last known owner’s manager and the application owner.
- Observe. Watch for authentication failures and application errors for an agreed window, commonly 30 days. Any failure tells you the account still had a job and needs a named owner.
- Transfer or archive data. Move mailbox, file share and repository ownership to a successor before deletion, following your retention policy and any legal holds.
- Delete and record. Remove the account, keep the ticket as evidence, and update the inventory. Auditors will ask for proof, not intent.
Two exceptions need written rules. Break-glass accounts should be dormant by design, so exclude them from automated disablement but monitor every use.
Shared or generic accounts should be converted to named accounts or vaulted credentials where possible, because they are the hardest identities to attribute.
Preventing new orphans with identity governance
Discovery and cleanup are a one-time project unless the process that creates orphans is fixed.
Strong identity lifecycle management ties every account to an authoritative event: a hire, a role change, a contract end or an application decommission.
Identity governance and administration (IGA) platforms automate those events, but the same principles apply with scripts and tickets.
Controls that keep the problem small
| Control | What it prevents | Framework reference |
|---|---|---|
| HR-driven provisioning and automatic leaver disablement | Leaver accounts that stay enabled | CIS 5.1, 6.2; NIST CSF 2.0 PR.AA |
| Disable accounts after 45 days of inactivity | Long-lived dormant accounts | CIS 5.3 |
| Service account inventory with owner and review date | Ownerless non-human identities | CIS 5.5 |
| Centralized account management through SSO and SCIM | Local SaaS accounts missed by offboarding | CIS 5.6 |
| Expiry dates on contractor and guest accounts | Third-party accounts outliving contracts | CIS 6.1, 6.2 |
| Quarterly access reviews certified by managers | Role-change leftovers and privilege creep | NIST SP 800-53 AC-2 |
CIS Safeguard 5.3 sets a concrete target: delete or disable dormant accounts after 45 days of inactivity where supported.
That number is easy to report on and is a sensible default for human accounts, with documented exceptions for seasonal staff and emergency access.
Strengthen authentication on what remains
Every case above involved an account without MFA. Requiring phishing-resistant MFA for all remote access and privileged roles reduces the value of a stale password even when cleanup lags.
Platform changes help here: Microsoft has announced plans to retire SMS and voice MFA in Entra ID in favour of passkeys, which makes this a good time to review which old accounts still rely on weak methods.
Measuring progress and reporting to leadership
Boards and regulators are more security-conscious about identity than they were a few years ago, and they respond better to trends than to one-off counts. A small set of metrics covers most needs:
- Number of enabled accounts with no matching owner, split into human and non-human.
- Median time from HR termination to account disablement, with a target measured in hours.
- Percentage of service accounts with a named owner and a review in the last 90 days.
- Percentage of dormant accounts disabled within the policy window.
- Number of dormant-account sign-in alerts and how many were confirmed malicious.
Report the leaver metric to HR leadership as well as to IT. Late or missing termination records cause many orphaned accounts, and fixing the data feed is often cheaper than any tool.
Key takeaways
- Orphaned accounts are valid identities without an accountable owner; dormant accounts are ones not used within a set period. Track both.
- Documented intrusions at a US state government, Microsoft and Colonial Pipeline all began with a forgotten account that lacked MFA.
- Non-human identities such as service accounts, OAuth apps and API keys need owners and review dates, because HR offboarding never touches them.
- Discovery means correlating every identity store against HR and a service account inventory, then classifying each account.
- Deprovision in stages: contain, notify, observe, transfer data, delete and record evidence.
- CIS Controls v8 Control 5 gives practical targets, including disabling dormant accounts after 45 days.
FAQ
What is an orphaned account in cybersecurity?
It is a user or machine account that still works but no longer has a current owner, such as a leaver’s login that was never disabled or a service account whose application was retired. Attackers value them because nobody notices when they are used.
How long before an inactive account should be disabled?
CIS Controls v8 Safeguard 5.3 recommends deleting or disabling dormant accounts after 45 days of inactivity where the system supports it. Document exceptions such as break-glass accounts and monitor them separately.
How do I find orphaned service accounts?
Export service accounts, service principals, OAuth apps and API keys from each platform, then match them to an inventory with owner, purpose and review date. Anything without an owner, or with no authentication in your window, goes into a review queue.
Should orphaned accounts be deleted or disabled first?
Disable first, revoke sessions and secrets, and observe for errors during an agreed window before deletion. This avoids outages when an account turns out to support a business process.
Which MITRE ATT&CK technique covers orphaned account abuse?
Valid Accounts (T1078) and its sub-techniques for default, domain, local and cloud accounts cover the use of existing credentials. Adding credentials or permissions to an old identity falls under Account Manipulation (T1098).