@riskymanag3ment $90DaysAgo = (Get-Date).AddDays(-90)
(Get-ADUser -Filter {Enabled -eq 'True' -and LastLogonDate -gt $90DaysAgo} -SearchBase $OU).count
Conversation
Notices
-
Embed this notice
Jake Hildreth (acorn) :blacker_heart_outline: (horse@infosec.exchange)'s status on Saturday, 22-Jul-2023 22:31:22 JST Jake Hildreth (acorn) :blacker_heart_outline: -
Embed this notice
David A. Pirata Informático :verified: (riskymanag3ment@infosec.exchange)'s status on Saturday, 22-Jul-2023 22:35:37 JST David A. Pirata Informático :verified: @horse learning to filter on dates is huge for last logons, last password set, created, updated.
-
Embed this notice
Jake Hildreth (acorn) :blacker_heart_outline: (horse@infosec.exchange)'s status on Saturday, 22-Jul-2023 22:37:52 JST Jake Hildreth (acorn) :blacker_heart_outline: @riskymanag3ment Right! Flip that one around and you can find users that probably should be disabled:
$90DaysAgo = (Get-Date).AddDays(-90)
(Get-ADUser -Filter {Enabled -eq 'True' -and LastLogonDate -lt $90DaysAgo} -SearchBase $OU).count
-
Embed this notice