Set-ADUser multiple Identities not working

Hey all, so trying to see if can get an extra hand on this…I am trying to pass a few variables into AD user attributes. Works for one user, but when add multiple users, it won’t pass separate objects. Not sure what I am missing…or better way to do this!

#Establishing Search Base OU
$Base = "OU=TST,OU=IT,DC=domain,DC=com

#Query and Set Values Replacement Attributes
$GivenName = (Get-ADUser -SearchBase $Base -Filter { (idautoPersonPreferredName -notlike "*") -and (idautoPersonPreferredLastName -notlike "*") -and (enabled -eq $true) } -Properties GivenName).GivenName; 
$SurName = (Get-ADUser -SearchBase $Base -Filter { (idautoPersonPreferredName -notlike "*") -and (idautoPersonPreferredLastName -notlike "*") -and (enabled -eq $true) } -Properties Surname).Surname;
$User = (Get-ADUser -SearchBase $Base -Filter { (idautoPersonPreferredName -notlike "*") -and (idautoPersonPreferredLastName -notlike "*") -and (enabled -eq $true) } -Properties "Name").Name;

#Set User Attributes
ForEach-Object {
Set-ADUser -Identity "$User" -Replace @{ idautoPersonPreferredName="$GivenName";idautoPersonPreferredLastName="$SurName" }
}

Hello @sneebly,
One of the possible way to do it will be something like following:

#Establishing Search Base OU
$Base = "OU=TST,OU=IT,DC=domain,DC=com"

#Query and Set Values Replacement Attributes
$User = (Get-ADUser -SearchBase $Base -Filter { (idautoPersonPreferredName -notlike "*") -and (idautoPersonPreferredLastName -notlike "*") -and (enabled -eq $true) } -Properties Name,Surname,GivenName)

#Set User Attributes
foreach ($item in $User)
{
    Set-ADUser -Identity $item.Name -Replace @{ idautoPersonPreferredName=$($item.GivenName);idautoPersonPreferredLastName=$($item.Surname)}
}

Hope that help.