Modify a User’s UPN with Powershell
Thu, Jun 25, 2009Here is a simple Powershell script to modify a User’s UPN in Active Directory. To use this, you must install Quest’s Active Directory commandlets. Obviously you should always be careful when modifying active directory, and the author isn’t responsible for what you break.
modifyupn.ps1
$samaccount=Read-Host "Enter users SAM account name"
$newupn=Read-Host "enter a new UPN"
Set-QADUser $samaccount -objectAttributes @{userprincipalname=$newupn}