UPA Sync Service启动之后立即自动停止

通过查看ULS日志, 可以发现下面的记录

ILM Configuration: The ValidateMiisEncryptionKey process returned True.
Synchronization database was not previously initialized. Exporting the encryption key from the registry key to the database
ILM Configuration: The ExportMiisEncryptionKey process completed successfully
UserProfileApplication.SynchronizeMIIS: Failed to configure MOSS initial MAs, will attempt during next rerun. Exception: System.Management.ManagementException: Generic failure      
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)   
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()   
at Microsoft.Office.Server.UserProfiles.Synchronization.ManagementAgent.ManagementAgentCollection.ManagementAgentEnumerator.MoveNext()   
at Microsoft.Office.Server.UserProfiles.UserProfileConfigManager.IsMossMaConfigured(UserProfileApplication application)   
at Microsoft.Office.Server.Administration.UserProfileApplication.SetupSynchronizationService(ProfileSynchronizationServiceInstance profileSyncInstance).

解决方案

$syncdb=Get-SPDatabase <SyncDBGUID>

$syncdb.Unprovision()

$syncdb.Status='Offline'

$upa=Get-SPServiceApplication <UPSAppGUID>

$upa.ResetSynchronizationMachine()

$upa.ResetSynchronizationDatabase()

$syncdb.Provision()

原文地址:https://www.cnblogs.com/awpatp/p/2267847.html