Monthly Archives: November 2015

Fix “User ‘xxx\xxx’ has a manager” when using the Add-SPProfileLeader PowerShell command

The SharePoint Health Analyzer reported that “People search relevance is not optimized when the Active Directory has errors in the manager reporting”. So in order to fix this problem I wanted to execute the ‘Add-SPProfileLeader’-command on our CEO.

SharePoint, however, stated that “User ‘domain\ceo’ has a manager.”
But in order to be ‘Profile Leader’ the account must not have a manager!

PS C:\Users\sp_farm> Add-SPProfileLeader $SPSAP -Name domain\ceo
Confirm
Are you sure you want to perform this action?
Performing operation "Add-SPProfileLeader" on Target
"domain\ceo".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):Y
Failed. User 'domain\ceo' has a manager.

I checked the AD and to my suprise the Manager-attribute was empty. No matter what I tried, I couldn’t fix this issue until I checked what’s going on in SharePoint’s database itself.

So, here is how I fixed the issue:

Continue reading

Convert Script-Editor-Webpart-Textarea to a real code editor with CodeMirror.js

I use the Script Editor Webpart very often and what always bothers me is that there is no proper code formatting in the textarea. So after some messing around with the CodeMirror-editor (a text editor implemented in JavaScript), I came up with a piece of code which will convert the textarea of a Script Editor Webpart to a real code editor including syntax-highlighting, proper indenting, fullscreen-editing, search, etc..

Continue reading