SharePoint: how check if a user has "Replicating Directory Changes" permission

In the User Profile Synchronization job, the user running it must have in Active Directory the permission "Replicating Directory Changes".

By one client, there was a debate between the client itself and one of its supplier offering the AD services about if the user had this permission.

To check this, I have found a PowerShell script doing this test in Checking Replication Directory Changes for account by PowerShell.

For reference I have copied the script here: CheckRDC.ps1 (1.4KB), then you can run it with:

     .\CheckRDC.ps1 “DOMAIN\username”

SharePoint: workflow performance

In SharePoint, there can be multiple factors that can affect workflow performance:

  • having dedicated history list and task lists, for each workflow
  • making sure that in both history lists and task lists there are maximum 2,000 items per folder (eventually create a folder structure);
  • respect the boundary of maximum 8k bytes for metadata storage;
  • keep ULS log file sizes small

Some interesting links are:

SharePoint: how deploy lists or document libraries with a predefined folder structure via CAML

In SharePoint, it's possible to deploy lists and libraries with a predefined folder structure via CAML.

Simply, in the ListInstance tag, add Row tags (inside a global Rows parent tag), as shown in Provision a folder inside a document library.

It's also possible to create nested folders using the FileDirRef tag.

For example, the xml below creates one folder (FolderA) with a nested folder (FolderBinA) with a nested folder (FolderCinB).

<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="">

<ListInstance FeatureId="{00bfea71-e717-4e80-aa17-d0c71b360101}" TemplateType="101" Title="DamianoDocLib" Description="" Url="DamianoDocLib" CustomSchema="Files\DamianoDocLib\Schema.xml" HyperlinkBaseUrl="http://test_sp" RootWebOnly="FALSE" xmlns="">




<Field Name="ID">1</Field>

<Field Name="ContentTypeId">0x0120003CCC413DD038BE4CAB81E6C6F4C08742</Field>

<Field Name="_ModerationStatus">0</Field>

<Field Name="FSObjType">1</Field>

<Field Name="FileLeafRef">FolderA</Field>

<Field Name="MetaInfo">1;#</Field>

<Field Name="Order">100.000000000000</Field>

<Field Name="Title">FolderA</Field>



<Field Name="ID">2</Field>

<Field Name="ContentTypeId">0x0120003CCC413DD038BE4CAB81E6C6F4C08742</Field>

<Field Name="_ModerationStatus">0</Field>

<Field Name="FileDirRef">FolderA</Field>

<Field Name="FSObjType">1</Field>

<Field Name="FileLeafRef">FolderBinA</Field>

<Field Name="MetaInfo">2;#</Field>

<Field Name="Order">200.000000000000</Field>

<Field Name="Title">FolderBinA</Field>



<Field Name="ID">3</Field>

<Field Name="ContentTypeId">0x0120003CCC413DD038BE4CAB81E6C6F4C08742</Field>

<Field Name="_ModerationStatus">0</Field>

<Field Name="FileDirRef">FolderA/FolderBinA</Field>

<Field Name="FSObjType">1</Field>

<Field Name="FileLeafRef">FolderCinB</Field>

<Field Name="MetaInfo">3;#</Field>

<Field Name="Order">300.000000000000</Field>

<Field Name="Title">FolderCinB</Field>






SharePoint: wrong password cached

This morning I was not able to access my usual SharePoint site.
It said my password is wrong, but I was able to access other SharePoint sites from the same farm.

I have found the article SharePoint caches incorrect credentials, that suggests to delete the saved credential in the client from computer from "Manage your network passwords" in Control Panel.

In short, you can find them in Control Panel, User Accounts, then Manage your network passwords.

SharePoint and JavaScript CSOM

I'm relizing that I'm spending too much time googling the same topics over and over (on JavaScript programming), so I list here a few solution I need in a recurrent way.


JavaScript: how understand if page is opened in iFrame, and get its url


Javascript: how get url parameters

  • function to get query string parameters:
    function getURLParameter(name) {
    return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(||[,""])[1].replace(/\+/g, '%20'))||null
  • source: How to get URL parameters with Javascript?


Javascript: function to format numbers


Javascript: function to format date-times


Javascript: how html encode strings


jQuery: how write a custom filter method

SharePoint: grouping items into folders

For a project I had to create view and group list items based on the folders they reside.

Short answer: in SharePoint you can't group by folder (name).

So you have to map the folder information into some column associated to your data:

  • create a text / choice column to store the folder name
    if you have deeper levels, you can consider create a taxonomy column
  • map the folder to the newly created column via folder default values or eventually workflow (more extensible but slower)


An article explaining the concept using folder default values is Group Items on Their Folder Name Inside a SharePoint Library. This article also remembers that SharePoint folder default values don't exist in SharePoint 2007 and SharePoint 2010 Foundation.