Replace line #1 in the code below to load the hash with your CSV.
$x= [PSCustomObject]@{tSamaccountname='mike';gSamaccountname='michael'}, [PSCustomObject]@{tSamaccountname='mark';gSamaccountname='marcus'}
[System.Collections.ArrayList]$a = @('mike','mark')
$h = @{}
$x |
ForEach-Object{
$h.($_.tSamaccountname) = $_.gSamaccountname
}
for ($i =0; $i -lt $a.count; $i++){
if ($h.ContainsKey($a[$i])){
$a.item($i) = $h.($a[$i])
}
}
$a