Quand normalement rime avec rarement !

An unhandled exception occurred in the Autodiscover service (EventID 1 & 2005)


Unhandled Exception "displayName has zero length
Parameter name: displayName"
Stack Trace:    at Microsoft.Exchange.Data.Storage.ExchangePrincipal.FromMailboxData(String displayName, String serverFqdn, String serverLegacyDN, String mailboxLegacyDN, Guid mailboxGuid, Guid mdbGuid, String primarySmtpAddress)
   at Microsoft.Exchange.Autodiscover.Providers.Outlook.OutlookAutoDiscoverProvider.GetRedirectURL()
   at Microsoft.Exchange.Autodiscover.Core.Service.GenerateResponse()
   at Microsoft.Exchange.Autodiscover.Default.OnLoad(EventArgs args)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The Autodiscover request processed with error, User SID:"S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxx", HostAddress:"10.xxx.xxx.xxx", HostName:"10.xxx.xxx.xxx".


Comme indiqué dans l'event ID 1, l'utilisateur n'a pas de Display Name (longueur de 0).


Remettre un Display Name à l'utilisateur

Retrouver l'utilisateur

Méthode 1 - Exchange Management Shell 2007 / Get-User

[PS] Get-User -Filter { Sid -eq "S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-500" }

Name                                                        RecipientType
----                                                        -------------
Administrator                                               UserMailbox

Méthode 2 - Exchange Management Shell 2010+ / Get-User

[PS] Get-User "S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-500"

Name                                                        RecipientType
----                                                        -------------
Administrator                                               UserMailbox

Méthode 3 - PowerShell / .Net Security Principal

[PS] $SecurtityIdentifier = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-500")
[PS] $SecurtityIdentifier.Translate([System.Security.Principal.NTAccount])


Méthode 4 - PowerShell avec module ActiveDirectory / Get-ADUser

[PS] Import-Module ActiveDirectory
[PS] Get-ADUser "S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-500"
DistinguishedName : CN=Administrator,CN=Users,DC=newlab,DC=local
Enabled           : True
GivenName         :
Name              : Administrator
ObjectClass       : user
ObjectGUID        : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SamAccountName    : Administrator
SID               : S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-500
Surname           :
UserPrincipalName : Administrator@newlab.local

Remettre le Display Name

Méthode 1 - Automatique

[PS] Get-Mailbox Administrator | Set-Mailbox
WARNING: The object newlab.local/NewLab/Users/Administrator has been corrupted, and it's in an inconsistent state.
The following validation errors happened:
WARNING: DisplayName is mandatory on UserMailbox.
[PS] Get-Mailbox Administrator | fl DisplayName
DisplayName : Administrator

Méthode 2 - Manuelle

[PS] Set-Mailbox Administrator -DisplayName "Administrator"
[PS] Get-Mailbox Administrator | fl DisplayName
DisplayName : Administrator