Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Script to update the UPN suffix

$
0
0

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.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>