I m trying to change the UPN suffix for users in test OU using Powershell script, however it is prompting for values:
#Script to update the UPN suffix
Get-ADUser -SearchBase "ou=Test,dc=THG,dc=local" -SearchScope OneLevel -filter * |
ForEach-Object {
$newUPN = $_.UserPrincipalName.Replace('THG.local', 'hensongroup.com')
$_ | Set-ADUser -server ADDS01 -UserPrincipalName $newUPN
}
When executed it says supply values for following parameters: Process[0] and so on.
Can you please check or provide working script to change UPN for users in particular OU.