I had to find the last time a particular server had logged on for a client the other week, so we knew for sure it was dead!
Solution
The two commands you may need are;
Locate Servers Last Login Time
Get-ADComputer -Filter {OperatingSystem -Like '*SERVER'} -Properties lastlogondate,operatingsystem | Select name,laslogondate,operatingsystem
Locate Clients Last Login Time
Get-ADComputer -Filter {OperatingSystem -notLike '*SERVER'} -Properties lastlogondate,operatingsystem | Select name,laslogondate,operatingsystem
Short and sweet!
0 Comments