List Active Directory users that have never logged in including built-in users using PowerShell
I was trying to find a way to identify what the unused user accounts were in my AD environment. I started playing with PowerShell’s get-aduser cmd-let. The working script that I came up with is below.
get-aduser -f {-not ( lastlogontimestamp -like "*") -and (enabled -eq $true)} | select name
Eric Sarakaitis
Virtualization Engineer at CBTS
I'm Eric, I love to cook, sing, garden and enjoy cold beverages!
Latest posts by Eric Sarakaitis (see all)
Tags: Active Directory, PowerShell
