Vous obtenez une exception de type System.Security.SecurityException quand vous essayez de démarrer le service de Synchonisation des profils utilisateurs dans SharePoint 2010

 

Symptôme

Dans SharePoint Server 2010, sous certaines conditions, vous pouvez rencontrer le message d’erreur suivant lorsque vous essayez de démarrer le service de synchronisation des profils utilisateurs (User Profile Synchronization Service dans l’administration centrale en anglais) :

UserProfileApplication.SynchronizeMIIS: Failed to configure ILM, will attempt during next rerun. Exception: System.Security.SecurityException: There are currently no logon servers available to service the logon request. at System.Security.Principal.WindowsIdentity.KerbS4ULogon(String upn) at
System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName, String type) at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName) at Microsoft.IdentityManagement.SetupUtils.IlmWSSetup.GetDomainAccountSIDHexString(String domainName, String accountName) at
Microsoft.IdentityManagement.SetupUtils.IlmWSSetup.GrantSQLRightsToServiceAccount() at Microsoft.IdentityManagement.SetupUtils.IlmWSSetup.IlmBuildDatabase() at Microsoft.Office.Server.UserProfiles.Synchronization.ILMPostSetupConfiguration.ConfigureIlmWebService(Boolean existingDatabase) at
Microsoft.Office.Server.Administration.UserProfileApplication.SetupSynchronizationService(ProfileSynchronizationServiceInstance profileSyncInstance) The Zone of the assembly that failed was: MyComputer.

 

Cause

Cette erreur est liée à Kerberos :

Le processus OWSTIMER.exe essaye d’obtenir un ticket de service pour accéder à lui-même (un TGS dont le Sname/SPN = compte qui exécute OWSTIMER.exe), et de la part de lui-même.

Cependant, une sécurité presente dans Windows Server 2003 fait que le KDC renverra toujours une erreur “KDC_ERR_S_PRINCIPAL_UNKNOWN” si le compte pour lequel on demande un TGS n’a pas de SPN défini. Ceci est expliqué dans cet article Technet en anglais : https://technet.microsoft.com/en-us/library/cc772815(WS.10).aspx :

“Additionally, in Windows Server 2003, KDCs will not issue a service ticket for an account that does not have an SPN. If a service account were simply a user account with a human-generated password, then that account would be more vulnerable to an offline dictionary attack. For an account without an SPN, the KDC will return KDC_ERR_S_PRINCIPAL_UNKNOWN. However, the context of the error will be KRB_ERR_MUST_USE_USER2USER, which has the description of "Server principal valid for user-to-user only.""”

 

Résolution

La résolution est très simple, il suffit d’ajouter un SPN (quel qu’il soit) au compte qui exécute le processus OWSTIMER.exe, cela permettra d’obtenir un TGS de ce compte. Par exemple avec la commande suivante :

setspn –a NONE/NONE OWSTimerAccount

Le service de synchronisation peut être démarré juste après cette modification.

 

Par Yvan Duhamel, ingénieur support d’escalade sur SharePoint.