User Profile Synchonization Producing A Lot Of Errors On Export Stage And Not Importing Profiles

I have setup Profile Synchornization on one server and it used to work correctly. Then I had to delete the AD connection. Then recreated the connection. After this the profile sync did not add any users.

Using miisclient I can see that the other stages are importing users but the last one "Export" is producing a lot of ("ma-extension-error)" errors.

The exception displayed in the error details is the following:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: value
   at Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.IsEncodedClaim(String value)
   at Microsoft.Office.Server.UserProfiles.UserProfile..ctor(UserProfileManager objManager, String strAccountName, Hashtable properties)
   at Microsoft.Office.Server.UserProfiles.UserProfileManager.CreateProfileWithBulkProperties(Int64 importExportId, String strAccountName, Hashtable properties)
   at Microsoft.Office.Server.UserProfiles.ProfileImportExportService.<>c__DisplayClass26.<UpdateWithProfileChangeData>b__24(Int32 idx)
   at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.<ForWorker>b__c()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body)
   at Microsoft.Office.Server.UserProfiles.ProfileImportExportService.UpdateWithProfileChangeData(Int64 importExportId, ProfileChangeData[] profileChangeData)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Office.Server.WebServiceDirectProxy.WebMethodInfo.Invoke(Object webServiceInstance, Object[] args)
   at Microsoft.Office.Server.WebServiceDirectProxy.Invoke(String methodName, Object[] args)
   at Microsoft.Office.Server.UserProfiles.ManagementAgent.ProfileImportExportDirect.UpdateWithProfileChangeData(Int64 importExportId, ProfileChangeData[] profileChangeData)
   at Microsoft.Office.Server.UserProfiles.ManagementAgent.ProfileImportExportExtension.Microsoft.MetadirectoryServices.IMAExtensibleCallExport.ExportEntry(ModificationType modificationType, String[] changedAttributes, CSEntry csentry)

Any ideas?


January 30th, 2015 12:08pm

Hi Nikolay,

According to your error message, it says that the parameter Value is null which means the data does not export to User Profile Store. 

For troubleshooting your issue, you can try to reset User Profile Synchronization database as below:

1.Verify that the user account that is performing this procedure has the following credentials:

  • The user account that performs this procedure is a member of the Farm Administrators group on the computer that is running the SharePoint Central Administration website.
  • The user account that performs this procedure is a member of the Administrators group on the computer on which you installed the User Profile synchronization service. This is required to start the User Profile Synchronization service. After the User Profile Synchronization service is started you can remove the farm account from the Administrators group.

2.As a precaution, back up the User Profile service application. For more information, see Back up service applications in SharePoint 2013.

3.If you are using the My Site cleanup timer job, you must disable it before you reset the synchronization database. Otherwise, the job will delete all user profiles and My Sites from the farm. For information about this timer job, see the Timer job reference (SharePoint 2013). For information about the Windows PowerShell cmdlets that you use to enable and disable this timer job, see Use Windows PowerShell cmdlets to manage timer jobs in SharePoint 2013.

4.Disable the User Profile Incremental Synchronization timer job:

  • On Central Administration, click Monitoring.
  • Click Review job definitions.
  • Click User Profile Service Application Name-User Profile Incremental Synchronization.

Where User Profile Service Application Name is the name of the User Profile service application.

  • Click Disable.

5.On the Start menu, click All Programs.

6.Click Microsoft SharePoint 2013 Products.

7.Right-click SharePoint 2013 Management Shell and then click Run as administrator.

8.In the User Account Control dialog box, click Yes.

9.At the Windows PowerShell command prompt, type the following command to stop the SharePoint 2013 Timer service:

net stop sptimerv4

10.Copy the following code and paste it into a text editor, such as Notepad:

$syncdb=Get-SPDatabase <SyncDBGUID>
$syncdb.Unprovision()
$syncdb.Status='Offline'
$upa=Get-SPServiceApplication <UPSAppGUID>
$upa.ResetSynchronizationMachine()
$upa.ResetSynchronizationDatabase()
$syncdb.Provision()

11.Replace the following placeholders with values where:

<SyncDBGUID> is the GUID of the synchronization database.

<UPSAppGUID> is the GUID of the User Profile Service application.

For more information, see Get-SPDatabase.

12.Save the file as an ANSI-encoded text file and name the file ResetSyncDB.ps1.

13.At the Windows PowerShell change to the directory where you saved the file.

14.Type the following command:

./ResetSyncDB.ps1

15.Using SQL Server Management Studio, create a login in SQL Server for the User Profile synchronization service account (that is, the farm account). Then, in the synchronization database, create a database user who maps to the login and grant it access to the db_owner database role. For more information, see How to: Create a SQL Server Login, How to: Create a Database User, and Database-Level Roles.

16.At the Windows PowerShell command prompt, type the following command to start the SharePoint 2013 Timer service:

net start sptimerv4

17.Start the User Profile synchronization service. For more information, see the Start the User Profile Synchronization service section of the "Configure profile synchronization" topic.

18.Reset IIS. For more information about how to reset IIS, see the Reset IIS section of the "Configure profile synchronization" topic.

19.Create connections to the data sources. For more information, see Restore service applications in SharePoint 2013.

20.If you do not intend to use the My Site cleanup timer job, run profile synchronization. For more information about how to run profile synchronization, see Start profile synchronization manually in SharePoint Server 2013. If you intend to enable the My Site cleanup timer job, complete these additional steps before you enable the job:

  • Run two full profile synchronizations.
  • After the second profile synchronization is finished, on Central Administration, in the Application Management section, click Manage service applications.
  • Click the User Profile service application name, and then click Manage User Profiles.
  • On the Manage Profile Service page, in the People section, click Manage User Profiles.
  • Next to View, select Profiles Missing from Import.
  • In the Find Profiles box, type the domain for the profiles and then click Find.
  • For each profile that is returned, check the originating directory service, such as Active Directory, for the status of that profile. If the status of any of the returned profiles in the directory is not disabled or is not deleted, do not enable the My Site cleanup timer job. Contact Microsoft support for more assistance. Otherwise, enable the My Site cleanup timer job. For information about the Windows PowerShell cmdlets that you use to enable and disable this timer job, see Use Windows PowerShell cmdlets to manage timer jobs in SharePoint 2013.

21.Enable the User Profile Incremental Synchronization timer job:

  • On Central Administration, click Monitoring.
  • Click Review Job Definitions.
  • Click User Profile Service Application Name-User Profile Incremental Synchronization.

Where User Profile Service Application Name is the name of the User Profile service application.

  • Click Enable.

Reference:

https://technet.microsoft.com/en-us/library/ff681014(v=office.15).aspx#resetSync

http://blogs.msdn.com/b/spsocial/archive/2010/05/04/conceptual-view-of-how-user-profile-synchronization-works-in-sharepoint-2010.aspx

Thanks,

Eric

Forum Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

Eric Tao
TechNet Community Support

Free Windows Admin Tool Kit Click here and download it now
February 2nd, 2015 4:52am

I have recreated the application and now it is working.

February 2nd, 2015 5:00am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics