Untitled
Anonymous
plain_text
11/25/2024 7:44 AM
528 B
19
Indexable
Write-Host "Identifying machines that haven't checked in for $DaysSinceLastCheckIn days..." -ForegroundColor Cyan
$thresholdDate = (Get-Date).AddDays(-$DaysSinceLastCheckIn)
$inactiveComputers = $computers | Where-Object {
($_ .lastCheckInDateTime -eq $null) -or
([DateTime]$_ .lastCheckInDateTime -lt $thresholdDate)
}
Write-Host "Found $($inactiveComputers.Count) inactive machines."Editor is loading...
Leave a Comment