I want to rename SPPrincipals that are ADGroups.

I've tried with

$SPFarm = Get-SPFarm   
#$SPFarm.MigrateGroup("loginName", "newLoginName")
$SPFarm.MigrateUserAccount("loginName", "newLoginName", $false)

but no success. ("The user does not exist or is not unique.")

I know that is a ReadOnly field, however there is any way to do it via PS?

  • MigrateGroup should be able to handle this. What error are you getting? Commented Feb 7, 2013 at 16:46
  • "The user does not exist or is not unique" With a login name that exists, and is an SPWeb.EnsureUser(LoginName) valid.
    – fallout
    Commented Feb 8, 2013 at 7:56
  • Are you using claims? If not, are you using the full pre-windows2000 name? domain\groupname Commented Feb 8, 2013 at 12:40

2 Answers 2


Have you tried running the old STSADM way of migrating users - like the following script.

STSADM –o migrateuser –oldlogin MYDOMAIN\old –newlogin MYDOMAIN\new –ignoresidhistory

There might be orphaned users which doesn't get handled correct. You can clean up these orphans using the following script:

# Clean up accounts that is not imported correctly
# Ref: http://iedaddy.com/2012/02/sharepoint-2010user-information-lists-and-user-profile-cleanup/

$upsa = Get-SPServiceApplication | Where-Object {$_.TypeName -like "User Profile Service Application"}

# List all user accounts that is not imported correctly
Set-SPProfileServiceApplication $upsa -GetNonImportedObjects $true

# Remove user accounts not imported correctly 
# Uncomment line below to run
Set-SPProfileServiceApplication $upsa -PurgeNonImportedObjects $true

# Run a full User Profile Service Syncronisation, and make sure users end up in Profile database.
# If not, users who log in will create new NonImportedObject accounts

When this is done you need to run a full syncronization of you User Profile Service Application. These steps worked for me when the Active Directory changed and we needed to map users and groups of the new AD with the old AD.


I'm not familiar with this particular function, but elsewhere I know AD groups are treated as SPUsers, so perhaps you need MigrateUserAccount instead?

  • 1
    I've try both, and both return that 'user does not exist..' message. But thanks for the advice.
    – fallout
    Commented Feb 8, 2013 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.