Skip to content

YossiSassi/Get-LogonCount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Get-LogonCount

Queries the logonCount attribute from all domain controllers (RWDC + RODC), for all user accounts (and optionally computer accounts), or a specific account.

Helps to validate patterns (especially compared to WhenCreated, lastlogon etc.), resolve DC affinity issues etc.
Max value for LogonCount attribute is 65,535. Usually indicates programatic/service accounts.
No dependencies — uses .NET DirectoryServices only.

Sample default run

Examples:

all user account

.\Get-LogonCount.ps1

users + computers

.\Get-LogonCount.ps1 -IncludeComputers

specific account

.\Get-LogonCount.ps1 -SamAccountName svc_backup

specific computer account (need the '$' at the end of the name)

.\Get-LogonCount.ps1 -SamAccountName srvsps01$

wildcard search

.\Get-LogonCount.ps1 -SamAccountName "admin*"

save report as CSV (all user accounts)

.\Get-LogonCount.ps1 -ExportCsv

About

Count logons (queries the logonCount attribute from all domain controllers, for users and/or computers, all or specific accounts)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors