I couldn't help myself and played with it just for fun.
Get-WmiObject Win32_NetworkLoginProfile |
Sort -Descending LastLogon |
Select * -First 1 |
? {$_.LastLogon -match "(\d{14})"} |
% {
New-Object PSObject -Property @{
Name=$_.Name ;
LastLogon=[datetime]::ParseExact($matches[0], "yyyyMMddHHmmss", $null)
}
}