Jul 21

Enabling users for Lync fails with ContraintViolationNoLeadingOrTrailingWhitespace error

When trying to enable some users using Lync Control Panel, I was getting the following error:

Other accounts were not having any issues and I was member of the CsUserAdministrator and therefore had the correct rights.

When analyzing a Debug session (ADConnect, Powershell and Userservices) with the Snooper tool. It presented the following error message:

Component: PowerShell
Level: TL_ERROR
Flag: TF_COMPONENT
Function: OcsCmdlet.WriteError
Source: ocscmdlet.cs(455)
Local Time: 07/20/2011-16:45:42.472
Sequence# : 0008898E
CorrelationId :
ThreadId : 1F20
ProcessId : 2CDC
CpuId : 2
Original Log Entry :
TL_ERROR(TF_COMPONENT) [2]2CDC.1F20::07/20/2011-14:45:42.472.0008898e(PowerShell,OcsCmdlet.WriteError:ocscmdlet.cs(455))(0000000001B23ADF) ErrorId=Validation,Microsoft.Rtc.Management.AD.Cmdlets.EnableOcsUserCmdlet,ErrorMessage =ConstraintViolationNoLeadingOrTrailingWhitespace,StackTrace=

The error message basically mentions that there is a space character (" ") after the selected user object. In the Active Directory, the User object had a trailing space after the Displayname. When that was correct, all provisioning was done without any error.

To my concern, this looks like something that should be fixed in the Powershell Enable-CsUser command… However, now you know how to resolve this issue.

Permanent link to this article: http://www.reijling.nl/?p=672

2 comments

    • Andrew on 13/09/2012 at 15:58

    Thank you!
    btw, it is first Google’s answer for request “constraintviolationnoleadingortrailingwhitespace” :)

    • Shura on 25/10/2012 at 23:05

    Thank you!
    Very simple solution! i’m found the whitespaces in the Fullname and displayname attributes..

Leave a Reply

Your email address will not be published.