How about this instead?
Import-CSV C:\users.csv |
ForEach-Object {
Try{
$u = Get-ADUser $_.name -Properties SAMAccountName,Manager -ErrorAction Stop
[PSCustomObject]@{User = $_.name; SamAccountName = $u.SAMAccountName; Manager = $u.Manager}
}
Catch{
[PSCustomObject]@{User = $_.name; SamAccountName = 'Not Found'; Manager = 'N/A'}
}
} | Export-CSV c:\managers.csv -NoTypeInformation