Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#AD Computer account last logon date
Get-ADComputer -Identity KLASSB315-2 -Properties LastLogonDate
#AD Computer account last logon date in days
$ADComputerInfo = Get-ADComputer -Identity PC1 -Properties LastLogonDate
$TimeSpan = New-TimeSpan -Start $ADComputerInfo.LastLogonDate -End (Get-Date)
$TimeSpan.Days
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.