# Gets time stamps for all computers in the domain that have NOT logged in since after specified date
# Mod by Tilo 2013-08-27
import-module activedirectory
$domain = "contoso.com"
$DaysInactive = 120
$time = (Get-Date).Adddays(-($DaysInactive))
# Get all AD computers with lastLogonTimestamp less than our time
Get-ADComputer -Filter {LastLogonTimeStamp
(
Read more... )