Find computers that last logged on 360 days ago with PowerShell
Use this code to find computers that last logged on 360 days ago:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$date = [DateTime]::Today.AddDays(-360); Get-ADComputer -Filter 'LastLogonDate -lt $date' -Properties LastLogonDate | FT Name,LastLogonDate |
Kommentarer
Send en kommentar