Just spotted that the code has a mistake in it, which means that the same DC is queried every timeYou need to change $user = Get-ADUser $userName | Get-ADObject -Properties lastLogon to $user = Get-ADUser $userName | Get-ADObject -Server $hostname -Properties lastLogonThis will query each of the DC in turn
↧