MIM 2016 Issues and Essentials

Ok, so recently I have been configuring the SharePoint 2016 connector with Microsoft Identity Manager 2016. MIM replaces FIM 2010 R2 for SharePoint profile synchronisation with AD and/or other providers (it also does a bunch of other stuff but I’m focusing on Sync only here). In SharePoint 2016, you can still your the embedded AD sync function if you like, but remember that is uni-directional (pull from AD) only. In my case, I need to push some properties set in the SP profiles into AD as well.
To save you some time, here are some tips for getting MIM syncing SharePoint profiles:

Use the PnP provided toolkit BUT make an update to the ps module file. You need to update lines 81 and 82. And don’t forget to reload the module after making the changes.


if ($MimPowerShellModuleAssembly.VersionInfo.ProductMajorPart -eq 4 -and
$MimPowerShellModuleAssembly.VersionInfo.ProductMinorPart -eq 4 -and
$MimPowerShellModuleAssembly.VersionInfo.ProductBuildPart -ge 1237)
{
Write-Verbose “Sufficient MIM PowerShell version detected (>= 4.4.1237): $($MimPowerShellModuleAssembly.VersionInfo.ProductVersion)”
}

This is a pretty good blog to follow for setting up the whole process:
https://thesharepointfarm.com/2016/03/basic-mim-configuration-support-sharepoint-2016/

Now, if for any reason the hookup fails (using these tools), you need to get a fresh copy of the ADMA files (XML) before re-running. Else you are going to get errors like: The property ‘name’ cannot be found on this object. Verify that the property exists and can be set.

This is a good post that explains it: https://social.technet.microsoft.com/wiki/contents/articles/33816.error-during-the-installation-of-sharepoint-server-configuration-file-user-profile-service-mim.aspx

Make sure you understand the basics about MIM before you begin, namely what the Metaverse and Connector Spaces refers to and the difference between Import, Sync and Export.

Search has encountered a problem that prevents results from being returned

I found this error while testing a search result source in a ported SharePoint 2013 site (to SharePoint 2016): Search has encountered a problem that prevents results from being returned. If the issue persists, please contact your administrator.
When I looked through the ULS there was a number of errors relating to the result source’s query. The issue, of course, was that I hadn’t reset the search index and done a full crawl since migrating and upgrading the content database.
Problem solved!

Error When Creating Links List Items (Hyperlinks)

In my case, I was using PowerShell to create a bunch of links to folders on a file-share in a SharePoint list. I came across errors when I used the 2010 method in 2013. Below I have provided examples of each method:

2010

$urlValue = New-Object Microsoft.SharePoint.SPFieldUrlValue("")
$urlValue.Description = "This is an awesome description"
$urlValue.Url =  "http://MyUrl.com"
$item["URL"] = $urlValue
$item.update()

2013

$newItem = $list.Items.Add()
$newItem["URL"] = "$urlString , $descriptionString"
$newItem["Comments"] = $descriptionString
$newItem.Update()

 

SharePoint Wiki Updated Pages Invalid index (Exception from HRESULT: 0x80070585)

After creating a SharePoint 2013 Wiki library, the quick launch navigation under Updated Pages reports “an error has occurred on the server.” When you click on the Updated Pages link it displays the error: Invalid index. (Exception from HRESULT: 0x80070585).

This error occurs when there is no index column in your Wiki list. To fix it, add a column for indexing:

Library Settings -> Index Columns: Create a new Index on the ‘Modified’ column.

There you have it. The problem should now be solved.

We’re having a problem opening this location in File Explorer.

There are a few circumstances under which you may come across this error :

We’re having a problem opening this location in File Explorer.  Add this web site to your Trusted Sites list and try again

Here I will provide a solution for one of those – You are trying to open a SharePoint document library in explorer view while on the SharePoint server.

There is an excellent post here that provides a detailed description of the problem and solution, but to summarise, you need to install the Desktop Experience feature under User Interfaces and Infrastructure on the server.

PowerShell scripts – Signing Error

Can’t Execute

If you attempt to execute a PowerShell script on the SharePoint server and  see : “Script cannot loaded.  The file is not digitally signed.  The script will not be executed on the system” or “… the execution of the script is disabled on the system…”

It means you either need to :

Sign the script OR

Set the PowerShell execution policy to allow you to execute unsigned scripts, e.g.

powershell.exe -executionpolicy bypass -file C:\script.ps1

Can’t Update

If you want to make changes to a PowerShell script but you are always prompted to save as a new version, the file may be locked. Right click the script file and select Properties. Ensure the Read-Only checkbox is unchecked. If there is a Unblock button next to the Read Only property, click Unblock.

Error 0x80070002 – Deploying Event Receiver

When using Visual Studio to package and deploy an event receiver to be associated with  SharePoint list, you may come across this error:

Error occurred in deployment step ‘Activate Features’: <nativehr>0x80070002</nativehr>

This probably means that your List URL is incorrect in the receiver elements file. The format needs to be :

<Receivers ListUrl="Lists/TestAnnouncements">

You may also see a Invalid Function error when you try to activate the feature manually in your site. Double check the URL of your list and ensure the list either exists or is being created at this URL prior to the receiver activation.

User cannot be found – Workflow Error

After migrating a SharePoint site to a new collection; which utilised a globally reusable SPD workflow, I of course expected that the workflow would not be available to the migrated sub site until I published an update. What I didn’t expect though was that updating the workflow would break it everywhere.

First of all I tried updating the workflow settings on the content type (in this case Document) to cascade the workflow settings down to all child content types (including those in the migrated sub site). This got me one step closer to my goal as the workflow then appeared associated with documents in the sub site, BUT once I tried to start a workflow, I got a big fat error: User cannot be found.

So next I opened SPD and updated the workflow and republished it (globally). That all worked and so I tested the workflow in the sub site again- User cannot be found.

So next came Google. I found plenty of people reporting the issue and many of those also bagged Microsoft for telling them that it could be fixed by simply re-publishing the workflow. Since I’d already tried that, I sympathised with their frustration.

Finally, with the magic of Google, I found this post which gave me the right answer. I logged in as an SCA and deactivated and then activated the site collection workflow feature and then started a workflow in my sub site.. Success!

workflow

Can’t Check Documents In: Missing Required Metadata

There could be a number of reasons for this issue; the most obvious being that you just haven’t completed the mandatory metadata on your document before checking  it in. However, I am assuming you are a little more cluey than that.

If you are dealing with a MS Office document (particularly Excel) and you are being diligent and filling out the required metadata in the DIP, saving and then trying to check it in and you are still being told you haven’t completed all the required metadata then I suspect the problem may be with Password Protection on the document or a workbook inside. Here is a good little summary of the issue.

The work around, while the desktop guys scramble around trying to tweak the group policy, is to close the document without checking it in, navigate to the document in the SharePoint document library and then Edit the properties of the document and set them in the Edit Metadata Form. When satisfied, check the document in via the library ribbon. Unfortunately this must happen every time the document is checked out for Edit. The same properties will always be wiped by the check in. If you can just turn off Protection on the document then that will stifle the issue as well. Depending on the business requirement, this may not be appropriate though.

Alternatively if Password Protection/Encryption is not your problem, then I must ask you whether you are using Lookup lists values as metadata in your document library? If so, make sure that the users trying to fillout the metadata and check the document in actually have sufficient access to the source Lookup list. If they don’t, they won’t be able to complete that piece of metadata.