Powershell

Active Directory’de -60 Gündür Login Olmayan Bilgisayarlar

Powershell-System-Automation

$Computerlist = get-content C:\unknown.txt

Foreach ($computer in $Computerlist)

{

Get-ADComputer -Filter “Name -like ‘$computer*'” -Properties * | Where-Object {$_.LastLogonDate -le (Get-Date).AddDays(-60)} |Select-Object Name, Enabled, LastLogonDate, IPv4Address | sort-object -property lastlogondate -Descending

}