Situatie
Vrei sa dezactivezi calculatoarele care nu au mai avut nicio activtate de mai mult de 180 de zile.
Solutie
Pasi de urmat
Rulezi Powershell pe serverul de Active Directory
$DaysInactive = 180 $time = (Get-Date).Adddays(-($DaysInactive)) get-adcomputer -filter {((LastLogonTimeStamp -lt $time) -or (LastLogonTimeStamp -notlike "*"))} -SearchBase "OU=name,OU=name,DC=win,DC=org,DC=TLD"` -Properties CN,name,LastLogonDate,*| foreach { Set-ADComputer -Identity $_ -Enabled $false $_ }| sort LastLogonDate -Descending | ft name,ipv4address,LastLogonDate | Out-File $homeDesktophost180.txt
Leave A Comment?