--- tags: - PowerShell - Reporting - Scripting --- ## Purpose This document records the procedure for inactive users. Follow the environment assumptions and commands below. ```powershell InactiveDays = 30 $Days = (Get-Date).Adddays(-($InactiveDays)) Get-ADUser -Filter {LastLogonTimeStamp -lt $Days -and enabled -eq $true} -Properties LastLogonTimeStamp | select-object Name,@{Name="Date"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp).ToString('MM-dd-yyyy')}} ``` ## Related Documentation - [Related Identity and Certificates Documentation](<../../../../reference/Identity and Certificates/index.md>) — Find the connected deployments, procedures, and references for this subject.