Find Unused, Inactive, or Old Computer Accounts using Powershell

Here’s a powershell script to get computer accounts that haven’t logged in for a while:

Get-QADComputer -SearchRoot 'OU=Servers,DC=ad,DC=contoso,DC=com' -IncludeAllProperties| where {$_.pwdLastSet -lt "8/12/2010"} | foreach {Write-host $_.Name $_.pwdLastSet}

Remember – this requires the Powershell Cmdlets from Quest.