Tuesday, 2 March 2021

How to Get the Last Logon Date and Time in Active Directory Computer.

 How to Get the Last Logon Date and Time in Active Directory Computer.


For Single computer.

 Get-ADComputer -Identity DC1 -Properties * | ft Name, LastLogonDate

For All Computer  

 Get-ADComputer -Filter * -Properties * | ft Name, LastLogonDate -AutoSize 

Export to CSV or Text file

 Get-ADComputer -Filter * -Properties * | ft Name, LastLogonDate -AutoSize | Out-File C:\users\Administrator\Desktop\comlist.txt 

No comments:

Post a Comment