phillips321/adaudit

Inaccurate Inactive Account List

exceedio opened this issue · 2 comments

Line 249 uses "-TimeSpan 180". The comment on line 246 indicates that the intention here is to list accounts that have not been active for 180 days but on my Windows Server 2012 R2 machine with PowerShell 4.0 that is not the actual outcome. The "180" is some time period that is shorter than 180 days.

Changing the "180" to (New-TimeSpan -Days 180) gave more accurate results:

$inactiveaccounts = Search-ADaccount -AccountInactive -Timespan (New-TimeSpan -Days 180) -UsersOnly

Top rate tool for doing a basic audit. Thank you for the work.

Thanks for this, I'll update the code and push for future releases.

this is now fixed in version 3.3. Thanks