Powershell – Bulk UPN Suffix für Benutzer ändern

Change UPN Suffix

Ändern des UPN-Suffix für mehrere Konten einer OU.

$new_suffix = “ndsedv.com” $users = Get-ADUser -Filter {UserPrincipalName -like ‘*’} -SearchBase “OU=IT,DC=ndsedv,DC=com” foreach ($user in $users) { $userName = $user.UserPrincipalName.Split(‘@’)[0] $UPN = $userName + “@” + $new_suffix Write-Host $user.Name $user.UserPrincipalName $UPN $user | Set-ADUser -UserPrincipalName $UPN }