Been writing script:
foreach ($Username in (Import-Csv -Path "C:\Users\...\nope.csv")) {
set-aduser $Username.Username -remove @{Proxyaddresses="smtp:$Username.Username@domain.com"}
Write-Output "remove proxy"
set-aduser $Username.Username -replace @{userPrincipalName="$Username.Username@domain.com"}
Write-Output "replace principal"
set-aduser $Username.Username -add @{Proxyaddresses="smtp:$Username.Username@domain.com"}
Write-Output "add proxy"
}
the code runs but ends up putting this garbage -> @{Username=###}.Username@domain.com in the attribute Editor.
Any help would be appreciated, been trying different ways for like 8h now.