Uzun bir süre Domain ortamına katılına makine üzerinde oturum açılmamış ise bu makineleri powershell üzerinden sorgulayarak bulabiliriz.
1 2 3 4 5 6 7 8 9 10 11 |
# Gets time stamps for all User in the domain that have NOT logged in since after specified date # Mod by Tilo 2013-08-27 import-module activedirectory $domain = "Domain Adı" #Kacgun icinde login olunmamis makineler sorgulanacak $DaysInactive = 90 $time = (Get-Date).Adddays(-($DaysInactive)) # Get all AD Computer with lastLogonTimestamp less than our time and set to enable Get-ADComputer -Filter {LastLogonTimeStamp -lt $time -and enabled -eq $true} -Properties LastLogonTimeStamp | # Output Name and lastLogonTimestamp into CSV select-object Name,@{Name="Stamp"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp)}} | export-csv C:\AllComputers.csv -notypeinformation |
DaysInactive alanında belirtilen süre içerisinde login olunmamış bilgisayarları listeler.