The below script was created to get the actual most recent AD LastLogon from all domain controllers. I need to get the oldest date or the most recent entry from the LastLogon attribute.
However, the results are different and it is quite confusing like below:

This is the script I've come up so far:
function Get-ADUserLastLogon([string]$userName) {
$dcs = Get-ADDomainController -Filter { Name -like "*" }
$time = 0
foreach ($dc in $dcs) {
Write-Host "Processing $($userName) ... $($dc.HostName) [$($(Resolve-DnsName -Name $dc.hostname).IPaddress)]" -ForegroundColor Green
$user = Get-ADUser $userName | Get-ADObject -Properties lastLogon
if ($user.LastLogon -gt $time) {
$time = $user.LastLogon
}
}
$dt = [DateTime]::FromFileTime($time)
Write-Host "`n" $username "last logged on at:" $dt " `n" -ForegroundColor Cyan
return $dt
}
$filter = { Enabled -eq $True}
$properties = 'Name', 'canonicalName', 'whenCreated', 'displayName', 'lastlogondate', 'lastlogon'
$Name = 'Enterprise.Admins'
Get-ADUser $Name -Properties $properties |
Select-Object -Property DisplayName,
SamAccountName,
UserPrincipalName,
WhenCreated,
@{ n = 'Most Recent Logon'; e = { Get-ADUserLastLogon -UserName $_.SamaccountName } },
@{ n = 'Real Last Logon'; e = { $sam = $_.SamaccountName; [datetime]::FromFileTime((Get-ADDomainController -Filter { Name -like "*" } | ForEach { Write-Host "Server: $($_.Name) - DisplayName: $($sam)" -ForegroundColor Yellow ; Get-ADUser $sam -Properties $properties -Server $_.Name | Select-Object LastLogon} | Measure-Object -Property LastLogon -Maximum).Maximum) } },
LastLogonDate | Out-GridView
How can we combine the above three columns Real Last Logon, Most Recent Logon and LastLogonDate into one proper column?