Get computer last logon date PowerShell

In this post, I describe how to get the last logon date for computers in Active Directory using PowerShell.

Get last logon date for a single computer

To retrieve the last logon date for a single computer, specified by name, use the following PowerShell cmdlet:

Get-ADComputer -Identity %COMPUTERNAME% -Properties LastLogonDate | FT Name, LastLogonDate

Screenshot showing PowerShell cmdlet to get the last logon date of a single computer


Get last logon date for all computers

To retrieve the last logon date for all computers in a domain, use the following PowerShell cmdlet:

Get-ADComputer -Filter * -Properties LastLogonDate  | FT Name, LastLogonDate

Screenshot showing PowerShell cmdlet to get the last logon date of all computers in a domain

Related Post

Comments

Popular posts from this blog

LG TV This app will now restart to free up more memory

LG TV Clear All Browsing History Data

Excel Import CSV not using "Use First Row as Headers"