10

Migrating users from one domain to another, I get this error on a couple of users. The migration still seems to occur.

Move-SPUser : pixels
At D:\UserMigration\MigrateUsers.ps1:10 char:28
+   $siteUser | Move-SPUser <<<<  -NewAlias $user.usernameAfter -IgnoreSID
    + CategoryInfo          : InvalidData: (Microsoft.Share...PCmdletMoveUser:
   SPCmdletMoveUser) [Move-SPUser], UserProfileException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletMoveUser

I loaded up a CSV full of before/after usernames and ran it on the list, and two of the users generated this error.

$user is just the CSV row, usernameAfter is the second column in that row.

$siteUser is an SPUser object created from $site.RootWeb.AllUsers[$user.usernameBefore].

Paraphrased script used:

$users = Import-CSV D:\UserMigration\MigrateTheseUsers.txt
$site = Get-SPSite https://sharepointsite.com
$web = $site.RootWeb

foreach($user in $users)
{
  $siteUser = $web.AllUsers[$user.usernameBefore]
  Write-Host User Before:
  $siteUser
  $siteUser | Move-SPUser -NewAlias $user.usernameAfter -IgnoreSID
  $siteUser = $web.AllUsers[$user.usernameAfter]
  Write-Host User After:
  $siteUser
}

Is this something I should be concerned about?

Update 1 Okay, I have one additional user that I receive this error for and the user does not get migrated. As circumstance has it, that user is my boss. Both a source and target user profile exist already but this has not been a problem in the past.

Update 2 I tried using stsadm instead to do the migration. I got the same result, without the PowerShell exception wrapper. I think this may be a generic exception bubbling up from the object model that just, for whatever reason, contains the text "pixels".

ULS shows the following error in the logs:

System.Data.SqlClient.SqlException:
  Cannot insert duplicate key row in object 'dbo.UserInfo' with unique index 'UserInfo_Login'.
  The statement has been terminated.

Without digging too deep into SQL, I'm not really sure what I can do about this without tainting the explicit "No direct DB operations!" rule of SharePoint. The relevant index is on the site ID, the login, and the deleted flag. I know I've migrated users before that have used both their old and new accounts at the same time, so that shouldn't be the issue.

5
  • O_o I fear the answer, but... "pixels" is by any way the alias of one of your user? I can't think of a reason for a similar message.
    – SPArcheon
    Mar 28, 2013 at 14:47
  • 1
    Negative. This error occurred for three different users, and as far as I'm aware, none of them would even know what pixels are without some prodding beforehand. Mar 28, 2013 at 15:02
  • Are you sure your import csv is correct? There is no loginname twice? Why you are not using the command as one liner? foreach($user in $users) {Move-SPUser –Identity $user.usernameBefore –NewAlias $user.usernameAfter -IgnoreSID}
    – LaPhi
    Mar 28, 2013 at 22:20
  • The CSV is fine. I get the error doing the same command inline. Read Update 2 - it's bubbling up from STSADM so it isn't a command execution issue. Mar 29, 2013 at 16:49
  • I know this post is old but I just did a stsadm -o migrateuser and the only thing it returned was the word 'pixels' as well.. I see the user appear twice in the permissions. no idea whats going on
    – pigeon
    Dec 11, 2013 at 5:18

0

Your Answer

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