John Yassa's Blog

Home » Windows Server 2008 » Change the UPN Suffix (User Principle Name) for Users in domain contorller

Change the UPN Suffix (User Principle Name) for Users in domain contorller

Below is a PS1 script to modify the UPN Suffix for Users inside OU

#Replace with the old suffix

$oldSuffix = ‘Existing UPN Domain name’

#Replace with the new suffix
$newSuffix = ‘New UPN Domain name

#Replace with the OU you want to change suffixes for
$ou = “LDAP Path of the OU that contain the users”

#Replace with the name of your AD server
$server = “Domain Controller name”

Get-ADUser -SearchBase $ou -filter * | ForEach-Object {
$newUpn = $_.UserPrincipalName.Replace($oldSuffix,$newSuffix)
$_ | Set-ADUser -server $server -UserPrincipalName $newUpn }


2 Comments

  1. markbauer says:

    Also you can do this with ADmodify.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: