How to change multiple users UPN suffix?

17.5k Views Asked by At

I'm preparing for a move to office365 and since we have the mydomain.local domain I need to add an alternative UPN (same as my SMTP namespace) so mydomain.com. I added the alternate UPN to my domain and now I want to change multiple users UPN at once.

I select multiple users > right click > properties > account > UPN suffix and select the UPN from the drop-down. When that's done I click OK or Apply and I get following error for all selected user:

The specified directory service attribute or value does not exist.

When I change it from one user it works without a problem.

My question now is, can someone help me solve tell me why this error is showing or what way I can achieve this.

Thanks

3

There are 3 best solutions below

0
On

You can try http://admodify.codeplex.com/.
There is an article showing an example of its uage here: http://blogs.technet.com/exchange/archive/2004/08/04/208045.aspx

0
On

Use the following powershell scripts. Change "contoso.local" to your actual domain name.

$localUsers = Get-ADUser -Filter {UserPrincipalName -like "contoso.local"} -Properties UserPrincipalName -ResultSetSize $null

$localUsers | foreach { $newUpn = $_.UserPrincipalName.Replace("contoso.local", "yourdomain.com"; $_ | Set-ADUser -UserPrincipalName $newUpn}
0
On

It is best to use a script to change bulk users rather than using the method you mentioned.

You can use either a PowerShell script (recommended) or a VBScript for this.

PowerShell script (using a CSV file):

http://gallery.technet.microsoft.com/Change-UPN-592177ea

PowerShell script (for all users in an OU searchbase):

http://community.spiceworks.com/scripts/show/1457-mass-change-upn-suffix

VBScript:

http://blogs.technet.com/b/heyscriptingguy/archive/2004/12/06/how-can-i-assign-a-new-upn-to-all-my-users.aspx?Redirected=true