The 45-day rule: check your own admin accounts in ten minutes

Essential Eight Maturity Level Two requires privileged access to be disabled after 45 days of inactivity. Here is how to check it yourself with read-only PowerShell, what the results really mean, and what to keep as evidence.

SS

Sam Sultan

Enact Cyber

23 November 2026

5 min read

ASD's Annual Cyber Threat Report 2025-26 puts it plainly: the easiest way into a network is with stolen or compromised legitimate credentials. (Executive summary, p. 3)

The most valuable credentials to steal are the ones with administrative rights. The least watched are the ones nobody uses any more: the contractor who left, the service account for a system that was retired, the admin account someone created "just for this weekend" in 2023.

That is why the Essential Eight has a specific rule about them. At Maturity Level Two, under Restrict Administrative Privileges, ASD requires that privileged access to systems and applications is disabled after 45 days of inactivity.

In our own Essential Eight lab, this was one of three findings: a Domain Admin account, unused for more than 45 days, still enabled. It is also one of the most common findings in real environments, because nothing breaks when it happens. The account just sits there.

This post shows how to check your own Active Directory for it in about ten minutes. Everything below is read-only. Nothing is changed.

Before you start

You need a Windows machine joined to the domain, with the Active Directory PowerShell module installed (it comes with the Remote Server Administration Tools). A normal domain account can usually read the attributes used here. You do not need to run anything on a domain controller.

Step 1: list enabled privileged accounts with no recent logon

$groups = 'Domain Admins', 'Enterprise Admins', 'Schema Admins', 'Administrators',
          'Account Operators', 'Backup Operators', 'Server Operators'
$cutoff = (Get-Date).AddDays(-45)

$results = foreach ($g in $groups) {
  Get-ADGroupMember -Identity $g -Recursive -ErrorAction SilentlyContinue |
    Where-Object objectClass -eq 'user' |
    Get-ADUser -Properties LastLogonTimestamp, Enabled |
    Where-Object { $_.Enabled -and [DateTime]::FromFileTime($_.LastLogonTimestamp) -lt $cutoff } |
    Select-Object @{n = 'Group'; e = { $g }}, SamAccountName,
      @{n = 'LastLogonTimestamp'; e = { [DateTime]::FromFileTime($_.LastLogonTimestamp) }}
}

$results | Sort-Object LastLogonTimestamp | Format-Table -AutoSize

This walks each built-in privileged group, including groups nested inside them, and lists every enabled user account whose recorded last logon is older than 45 days.

Two things to read correctly in the output:

  • A date in 1601 means the account has never logged on at all. That is usually the most interesting line on the page.
  • Enterprise Admins and Schema Admins only exist in the forest root domain. If you are not in it, those groups are skipped silently.

Step 2: understand what the date really means

The LastLogonTimestamp attribute is designed for exactly this job: finding stale accounts. But it is deliberately not precise. To avoid flooding replication, Active Directory only updates it periodically. Microsoft's own explanation is that with default settings it will be 9 to 14 days behind the current date.

So an account that shows 50 days of inactivity might really have logged on five weeks ago. Close enough to investigate. Not close enough to act on.

Step 3: confirm the real last logon before you act

The precise value is the LastLogon attribute, but it is not replicated: each domain controller only knows about logons it handled itself. To get the truth, ask every domain controller and take the most recent answer:

$user = 'svc.legacy'   # one account from Step 1

Get-ADDomainController -Filter * | ForEach-Object {
  $dc = $_.HostName
  $u  = Get-ADUser $user -Server $dc -Properties LastLogon
  [pscustomobject]@{ DC = $dc; LastLogon = [DateTime]::FromFileTime($u.LastLogon) }
} | Sort-Object LastLogon -Descending

The top line is the real last logon. If it is still more than 45 days ago, you have a confirmed finding.

Step 4: keep the evidence

A finding you cannot show later is an opinion. Save the output with the date it was collected:

$results | Export-Csv "privileged-inactive-$(Get-Date -Format yyyyMMdd).csv" -NoTypeInformation

Keep the file, the date, and who ran it. If an auditor, an insurer or a future you asks "how do you know?", that file is the answer. It is the same principle behind every finding in our reports: the expected value, the observed value, and where it came from.

Step 5: decide, then disable

Do not disable everything on the list automatically. Some accounts that look idle are service accounts used by a scheduled task or an application that only runs occasionally. Disabling one can quietly stop a system.

For each confirmed account, find the owner and ask one question: does this still need administrative access? If nobody can say yes, disable it, note who approved it, and keep that record with your evidence file.

What about Microsoft 365?

Admin accounts in Microsoft Entra ID (the identity system behind Microsoft 365) need the same treatment. The Entra admin center shows each user's sign-in activity. Reading the last successful sign-in date in bulk through Microsoft Graph needs a Microsoft Entra ID P1 or P2 licence and the AuditLog.Read.All and User.Read.All permissions. If you have hybrid identity, check both places: an account can be idle in one and active in the other.

Why this matters more than it looks

This check takes ten minutes, and most organisations have never run it. It is one control out of many, and a clean result does not mean you are secure. But it is a useful test of something bigger: whether your security picture is built from what your systems actually show, or from what everyone assumes.

Our AI-attacker readiness check includes an identity spot check like this one, alongside a review of what an automated attacker would find on your internet-facing systems. If you run the commands above and want a second pair of eyes on the results, get in touch.

ASD requirement quoted from the ASD Blueprint for Secure Cloud, Essential Eight: Restrict Administrative Privileges. Statistics from the ASD Annual Cyber Threat Report 2025-26. Microsoft behaviour from Microsoft's published documentation, linked above. Test any command in a non-production environment first.

Essential EightML2privileged accessActive DirectoryPowerShellevidence
SS

Sam Sultan

Founder, Enact Cyber

Building evidence-first compliance methodology at Enact Cyber. Every report grounded in real findings, never pre-written, never fabricated.

Ready to work differently?

Compliance that closes the gap, not just reports it.