Thursday, October 25, 2018

SharePoint 2013 - Exception while trying to migrate account 'xxxxxxxx\ksxxx' to 'xxxxxxxxx\ksxxx'

After successful configuration of User Profile Synchronization Service. I encountered another problem in the event viewer as below.

 "System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> Microsoft.Office.Server.UserProfiles.UserProfileException: Exception while trying to migrate account 'xxxanie\kstpe' to 'xxxANIES\kstpe'. ---> Microsoft.SharePoint.SPException: The user does not exist or is not unique. ---> System.Runtime.InteropServices.COMException: The user does not exist or is not unique.0x81020054

I checked with my IT team and yes DomainNetBIOS name was different then FQDN Domain. Some suggested to recreate the User Profile service. I really didn't want to recreate the User Profile service.

NetBiosDomainNamesEnabled is a property that is set on every User Profile Application. By default, this value is set to false which means that you must set it to true in the scenario where the domain netbios\FQDN names are different.

I tried setting this NetBiosDomainNamesEnabled property to true and tried to re-sync the profiles but it did not resolved the above error. To use the domain NetBIOS name, a new synchronization connection must be created and used. This means that you can’t use the existing synchronization connection.

Please follow below steps to resolve the above issue.
  1. Delete existing Synchronization Connections
    Central Admin > Application Management > Manage Service Applications > User Profile Service Application > Configure Synchronization Connections

    Delete the appropriate existing connection.
  2. Run the Following PS1 command to enable NetBiosDomainNamesEnabled 

    Get-SPServiceApplication
    # (lists the Service Applications and their GUIDs)
    $UPA = Get-SPServiceApplication –Id
    $UPA.NetBIOSDomainNamesEnabled=1
    $UPA.Update()
  3. Recreate the Connection 
  4. Restart IIS 
  5. Run Full Profile Syncronize
    Central Admin > Application Management > Manage Service Applications > User Profile Service Application > Start Profile Syncronisation

    Select "Start Full Synchronization" option and click ok.
  6. All user profiles will be corrected.
  7. You can see the progress by running miisclient.exe
    Location: C:\Program Files\Microsoft Office Servers\15.0\Synchronization Service\UIShell

    Note: Make sure you see following things in sequence in miisclient.exe