<# .SYNOPSIS Reports how people sign in to this Windows PC: PIN, password, fingerprint, face or iris. .DESCRIPTION READ-ONLY. Changes nothing on the device. Reads the Security, Biometrics and HelloForBusiness event logs for the last N days, finds every sign-in and unlock, and decides which method was used. Writes one CSV row per sign-in or unlock. The CSV opens in Excel, or drop it on the free Hello Sign-in Methods page on EndpointWeekly. Rules, checked in this order for each sign-in or unlock (from the EndpointWeekly post on Windows Hello gesture reporting, 29 June 2026, tested on real hardware): 1. Exact : HelloForBusiness event 5010 within 8 seconds names the method (ModalityUsedForLogon 0 = PIN, 1 = Face, 2 = Fingerprint, 3 = Iris). Only newer Windows builds write 5010. 2. Fingerprint : Biometrics event 1004 within 8 seconds whose message names a fingerprint sensor. 3. Face : Biometrics event 1004 that is not a fingerprint, or Biometrics 1702 within 5 seconds. 4. PIN : HelloForBusiness 5205 or 5702 within 8 seconds, and no biometric event. 5. Password: none of the above. A password leaves no Hello event, so this one is inferred. Sign-ins and unlocks come from the Security log: event 4624 with logon type 2, 7 or 11, and event 4801. A biometric event with no matching sign-in or unlock is listed as "Other Hello prompt" when the PC records unlocks (most likely an app asking for Windows Hello), or as "Biometric only" when it records none (most likely an unlock that was not audited). The Biometric service logs as SYSTEM, so the person is taken from the last sign-in or unlock before it, which can be on an earlier day if the session stayed open. Two things make the PIN and password rows complete: - Run as administrator. The Security log is admin-only. - Unlock auditing ("Other Logon/Logoff Events", success) must be on. Without it, a PIN or password unlock is not recorded at all. Face and fingerprint are logged either way. .PARAMETER Days How many days back to read. 1 to 90. Default 14. Most PCs keep only a few weeks of Security log. .PARAMETER CsvPath Where to save the CSV. Default: Desktop\hello-signin-methods-.csv .PARAMETER HideUserNames Replace user names with User 1, User 2 ... before saving. .EXAMPLE .\Get-HelloSignInMethods.ps1 Last 14 days, CSV on the Desktop. .EXAMPLE .\Get-HelloSignInMethods.ps1 -Days 30 -HideUserNames Last 30 days, user names replaced. .NOTES Version 1.0, 29 November 2026. EndpointWeekly free tools. https://endpointweekly.com/tools.html ASCII only, Windows PowerShell 5.1 and PowerShell 7. Exit code 0 = done, 1 = the Security log could not be read. #> [CmdletBinding()] param( [ValidateRange(1, 90)] [int]$Days = 14, [string]$CsvPath = '', [switch]$HideUserNames ) $ErrorActionPreference = 'Stop' # Matching windows in seconds (from the tested rules: keep them tight, background Hello events are noisy) $WinExact = 8 $WinFinger = 8 $WinFace = 5 $WinKey = 8 $WinDedupe = 3 $MODALITY = @{ '0' = 'PIN'; '1' = 'Face'; '2' = 'Fingerprint'; '3' = 'Iris' } $start = (Get-Date).AddDays(-$Days) $computer = $env:COMPUTERNAME if (-not $CsvPath) { $CsvPath = Join-Path ([Environment]::GetFolderPath('Desktop')) ('hello-signin-methods-' + $computer + '.csv') } $notes = New-Object System.Collections.ArrayList $securityFailed = $false $isAdmin = $false try { $isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) } catch { $isAdmin = $false } if (-not $isAdmin) { Write-Warning 'Not running as administrator. The Security log cannot be read, so PIN and password sign-ins will be missing.' } function Read-Events([string]$Log, [int[]]$Ids) { try { return @(Get-WinEvent -FilterHashtable @{ LogName = $Log; Id = $Ids; StartTime = $start } -ErrorAction Stop) } catch { if ([string]$_.FullyQualifiedErrorId -like 'NoMatchingEventsFound*') { return @() } [void]$notes.Add('Could not read ' + $Log + ': ' + $_.Exception.Message) if ($Log -eq 'Security') { $script:securityFailed = $true } return @() } } function Get-EventData($Evt) { $h = @{} try { $x = [xml]$Evt.ToXml() foreach ($d in $x.Event.EventData.Data) { if ($d.Name) { $h[[string]$d.Name] = [string]$d.'#text' } } } catch { } return $h } $nameCache = @{} function Resolve-Sid([string]$Sid) { if (-not $Sid) { return 'Unknown user' } if ($nameCache.ContainsKey($Sid)) { return $nameCache[$Sid] } $n = $Sid try { $n = (New-Object System.Security.Principal.SecurityIdentifier($Sid)).Translate([System.Security.Principal.NTAccount]).Value } catch { $n = $Sid } $nameCache[$Sid] = $n return $n } function Find-Near([datetime]$Time, $List, [int]$Seconds) { foreach ($item in $List) { if ($item -is [datetime]) { $t = $item } else { $t = $item.Time } if ([math]::Abs(($Time - $t).TotalSeconds) -le $Seconds) { return $item } } return $null } # ---- 1. sign-ins and unlocks (Security log) ---- $anchors = New-Object System.Collections.ArrayList foreach ($e in (Read-Events 'Security' @(4624, 4801))) { $d = Get-EventData $e $user = $d['TargetUserName'] $dom = $d['TargetDomainName'] if (-not $user) { continue } if ($user -match '\$$') { continue } if ($user -match '^(SYSTEM|LOCAL SERVICE|NETWORK SERVICE|ANONYMOUS LOGON)$') { continue } if ($user -match '^(DWM|UMFD)-\d+$') { continue } if ($e.Id -eq 4624) { $lt = $d['LogonType'] if (@('2', '7', '11') -notcontains $lt) { continue } if ($lt -eq '7') { $kind = 'Unlock' } else { $kind = 'Sign-in' } } else { $kind = 'Unlock' } if ($dom) { $who = $dom + '\' + $user } else { $who = $user } [void]$anchors.Add([pscustomobject]@{ Time = $e.TimeCreated; User = $who; Kind = $kind }) } # one sign-in often writes two or three Security events a second apart: keep one $dedup = New-Object System.Collections.ArrayList $last = $null foreach ($a in @($anchors | Sort-Object User, Time)) { if ($last -and $last.User -eq $a.User -and [math]::Abs(($a.Time - $last.Time).TotalSeconds) -le $WinDedupe) { if ($a.Kind -eq 'Unlock') { $last.Kind = 'Unlock' } continue } [void]$dedup.Add($a) $last = $a } # ---- 2. the signals ---- $bio = Read-Events 'Microsoft-Windows-Biometrics/Operational' @(1004, 1702) $b1004 = @($bio | Where-Object { $_.Id -eq 1004 } | ForEach-Object { [pscustomobject]@{ Time = $_.TimeCreated; IsFinger = ([string]$_.Message -match 'fingerprint|MOC'); Sid = [string]$_.UserId } }) $b1702 = @($bio | Where-Object { $_.Id -eq 1702 } | ForEach-Object { $_.TimeCreated }) $hfb = Read-Events 'Microsoft-Windows-HelloForBusiness/Operational' @(5205, 5702, 5010) $keyUse = @($hfb | Where-Object { $_.Id -eq 5205 -or $_.Id -eq 5702 } | ForEach-Object { $_.TimeCreated }) $exact = @($hfb | Where-Object { $_.Id -eq 5010 } | ForEach-Object { $dd = Get-EventData $_ [pscustomobject]@{ Time = $_.TimeCreated; Modality = [string]$dd['ModalityUsedForLogon'] } }) # ---- 3. classify ---- $rows = New-Object System.Collections.ArrayList $usedBio = @{} foreach ($a in $dedup) { $t = $a.Time $method = '' $basis = 'Inferred' $evidence = '' $near1004 = Find-Near $t $b1004 $WinFinger foreach ($bb in $b1004) { if ([math]::Abs(($t - $bb.Time).TotalSeconds) -le $WinFinger) { $usedBio[$bb.Time.Ticks] = $true } } $x = Find-Near $t $exact $WinExact if ($x -and $MODALITY.ContainsKey($x.Modality)) { $method = $MODALITY[$x.Modality]; $basis = 'Exact'; $evidence = 'HelloForBusiness 5010' } if (-not $method -and $near1004) { if ($near1004.IsFinger) { $method = 'Fingerprint' } else { $method = 'Face' } $evidence = 'Biometrics 1004' } if (-not $method -and (Find-Near $t $b1702 $WinFace)) { $method = 'Face'; $evidence = 'Biometrics 1702, no 1004' } if (-not $method -and (Find-Near $t $keyUse $WinKey)) { $method = 'PIN'; $evidence = 'HelloForBusiness 5205 or 5702, no biometric' } if (-not $method) { $method = 'Password'; $evidence = 'No Hello or biometric event' } [void]$rows.Add([pscustomobject]@{ Computer = $computer; User = $a.User; Date = $t.ToString('yyyy-MM-dd'); Time = $t.ToString('HH:mm:ss') Kind = $a.Kind; Method = $method; Basis = $basis; Evidence = $evidence }) } # Biometric events with no matching sign-in or unlock. # - If this PC records unlocks (unlock auditing is on), such an event is most likely an app or prompt asking for # Windows Hello (for example a passkey or an approval), not a sign-in: Kind = "Other Hello prompt". # - If it records no unlocks at all, it is probably an unlock that was not audited: Kind = "Biometric only". # The Biometric service writes 1004 as SYSTEM, so the person is taken from the last sign-in or unlock before it # (a session often stays open overnight, so this may be on an earlier day). $unlockSeen = @($dedup | Where-Object { $_.Kind -eq 'Unlock' }).Count -gt 0 $byTime = @($dedup | Sort-Object Time) foreach ($b in $b1004) { if ($usedBio.ContainsKey($b.Time.Ticks)) { continue } if ($b.IsFinger) { $m = 'Fingerprint' } else { $m = 'Face' } $ev = 'Biometrics 1004, no sign-in or unlock' if ($b.Sid -and $b.Sid -ne 'S-1-5-18') { $who = Resolve-Sid $b.Sid } else { $prev = $null foreach ($a in $byTime) { if ($a.Time -le $b.Time) { $prev = $a } } if ($prev) { $who = $prev.User; $ev += '; person = last sign-in or unlock before it' } else { $who = 'Unknown user' } } if ($unlockSeen) { $kind = 'Other Hello prompt'; $ev += '; probably an app asking for Windows Hello' } else { $kind = 'Biometric only' } [void]$rows.Add([pscustomobject]@{ Computer = $computer; User = $who; Date = $b.Time.ToString('yyyy-MM-dd'); Time = $b.Time.ToString('HH:mm:ss') Kind = $kind; Method = $m; Basis = 'Inferred'; Evidence = $ev }) } $rows = @($rows | Sort-Object Date, Time) if ($HideUserNames) { $map = @{} $i = 0 foreach ($r in $rows) { if (-not $map.ContainsKey($r.User)) { $i++; $map[$r.User] = 'User ' + $i } $r.User = $map[$r.User] } } # ---- 4. save and summarise ---- if ($rows.Count -gt 0) { $rows | Export-Csv -Path $CsvPath -NoTypeInformation -Encoding UTF8 } else { Set-Content -Path $CsvPath -Value '"Computer","User","Date","Time","Kind","Method","Basis","Evidence"' -Encoding UTF8 } $unlocks = @($dedup | Where-Object { $_.Kind -eq 'Unlock' }).Count if (-not $securityFailed -and $isAdmin -and $unlocks -eq 0) { [void]$notes.Add('No unlock events were found. If people lock and unlock this PC, unlock auditing ("Other Logon/Logoff Events") is probably off, so PIN and password unlocks are not recorded.') } $signRows = @($rows | Where-Object { $_.Kind -ne 'Other Hello prompt' }) $promptCount = $rows.Count - $signRows.Count Write-Host '' Write-Host ('Hello sign-in methods on ' + $computer + ', last ' + $Days + ' days: ' + $signRows.Count + ' sign-ins and unlocks') Write-Host '' foreach ($g in @($signRows | Group-Object User)) { $c = @{} foreach ($m in @('PIN', 'Password', 'Fingerprint', 'Face', 'Iris')) { $c[$m] = @($g.Group | Where-Object { $_.Method -eq $m }).Count } Write-Host ('{0,-32} PIN {1,4} Password {2,4} Fingerprint {3,4} Face {4,4} Iris {5,3}' -f $g.Name, $c['PIN'], $c['Password'], $c['Fingerprint'], $c['Face'], $c['Iris']) } Write-Host '' if ($promptCount -gt 0) { Write-Host ('Also ' + $promptCount + ' other Windows Hello prompts (an app asking for Hello, not a sign-in). They are in the CSV as "Other Hello prompt".') } foreach ($n in $notes) { Write-Warning $n } Write-Host ('Saved: ' + $CsvPath) if ($securityFailed) { exit 1 } exit 0