powershell code – Find computers

To find a single machine and the date it last logged on

Get-ADComputer -identity SRV-DB01 -Properties * | FT Name, LastLogonDate -Autosize
Find all the machines
Get-ADComputer -Filter * -Properties * | FT Name, LastLogonDate -Autosize