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: wrong domain name after user profile synchronization

If there is a NetBIOS domain name, the user profile synchronization in SharePoint will give incorrect results, because the users will be prefixed with the domain name (for example: "AD" in "ad.mycompany.com") instead of the NetBIOS domain name (for example: "MYCOMPANY-AD").

This problem is described well in WRONG DOMAIN NAME IN ACCOUNTNAME AFTER USER PROFILE SYNC.

The solution is to change the property of the User Profile Application to the value 1, and then recreate the connection and do a full synchronization.

This topic is described in the Microsoft Technet article Synchronize user and group profiles in SharePoint Server 2013.

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 2010: access with Safari in iOS 8

Because of a problem in the OOTB browser definitions in .NET 2, carried up to .NET 3.5, iPhone with iOS 8 are not correctly recognized as mobile devices in SharePoint 2010.

The problem is described in iOS 8 / Safari 8 not working with ASP.NET AJAX-Extensions, but the solution in that article is not complete, as it fixes the JavaScript issue but not the mobile capabilities.

So I have merged that solution with the iPhone capabilities in the OOTB browsers definitions, getting the content of the new file that you can download here: iOS8.browser

SharePoint 2010: customizing the view behind a XsltListViewWebPart

In SharePoint Designer 2010, trying to modify the view behind a XsltListViewWebPart can seem to be ineffective.

The problem is that even after saving the page, the web part is deserialized and it contains the view inside it; when deserializing the web part before saving, the old copy of the view is retrieved, so in the end the view saved in the page seems to be unchanged.

How can you solve this? Simply creating a view in the underlying list, making the web part to use this view, and then delete the view (because not used anymore, the view is now serialized with the web part).

FYI this issue is described in:

  • XLV Bug: View settings lost on saved XSLT List View Web Part: here there is a small error, in the end it says modifying the view works in SharePoint Designer, but it is only because the page is new. Updating the page (and not creating it) doesn't update the underlying view.
  • ListViewWebPart & SPView – two sides of the same coin: this post says a hidden view is created. In my case, trying to modify the view calling the modifyView page and tricking the ViewID query string parameter with the ID in the view in my XsltListViewWebPart didn't work.
    This is why I create a normal (not hidden) view to be associated to the web part (and for cleanness, at the end this temporary view can be deleted).

SharePoint: how retrieve the user manager in an approval workflow

In SharePoint it's quite easy to find the manager of a user, for example in an approval workflow.

Here are some links explaining how to do that:

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="http://schemas.microsoft.com/sharepoint/">

<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="http://schemas.microsoft.com/sharepoint/">

<Data>

<Rows>

<Row>

<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>

</Row>

<Row>

<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>

</Row>

<Row>

<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>

</Row>

</Rows>

</Data>

</ListInstance>

</Elements>

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.