Extract Documents to Folder based on Managed Metadata Column - SharePoint

Image
  How to Extract documents from Multiple Document libraries in to Folders. Each has a Managed Metadata Column with Sub Terms. I have created three Functions to  Download Document Create Folder Main Method Addition to above, script will log the Document URL and destination Folder Path in .log file Create Folder   Function   Create-Folder {      param  ( $folderPath )      if  (!( Test-Path  -path  $folderPath ))     {          New-Item   $folderPath  -type directory     } } Download Document ( this is stolen from Stackoverflow 😁 ) Function   Download-Document {      param ( $web ,  $folderPath ,  $docItem )       #File Download Snippet Reffered From : https://stackoverflow.com/questions/43350575/how-to-use-powershell-to-download-files-from-sharepoint        $File  =  $web .GetFile ( $docItem .Url )          $Binary  =  $File .OpenBinary ()          $detinationPath  =  $folderPath  +  "\"  +  $File .Name ;          $Stream  =  New-Object  System.IO.FileStream( $detinationPath

SP2013 User Profile Web Service Error

_api/SP.UserProfiles.PeopleManager Web Service Error in User Profile REST API

While we were testing the passive SharePoint farm, Developers started to get this error in their REST API calls.
It occurred during reading the user information through User Profile "_api/SP.UserProfiles.PeopleManager"

I have verified below 

  1. User Profile Service is up and running
  2. user Profile Synchronization Service is successfully running on the App Server
  3. FFM Service successfully running on the server
  4. Profile Synchronization is successfully executed with Active directory 
  5. My sites Web Application is available.
But Still we got below error on the Browser when we try the service URL

Error


This XML file does not appear to have any style information associated with it. The document tree is shown below.
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>

-1, Microsoft.SharePoint.Client.ResourceNotFoundException
</m:code>
<m:message xml:lang="en-US">
Cannot find resource for the request GetProperties.
</m:message>
</m:error>

When I dig in to the ULS Logs I was able to see below detail error messages.

Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.  
 at Microsoft.SharePoint.Portal.WebControls.PropertyImage.RenderControl(HtmlTextWriter writer)  
 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writerICollection children)  
 at Microsoft.SharePoint.WebControls.AjaxDelta.RenderChildren(HtmlTextWriter output)  
 at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer)  
 at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)  
 at Microsoft.SharePoint.WebControls.AjaxDelta.Render(HtmlTextWriter writer)  
 at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writerControlAdapter adapter)  
 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writerICollection children)  
 at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)  
 at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)  
 at Microsoft.SharePoint.WebControls.SharePointForm.Render(HtmlTextWriter output)  
 at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writerControlAdapter adapter)  
 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writerICollection children)  
 at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)  
 at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writerControlAdapter adapter)

Finally I was able to identify below specific error message 

SPMicrofeedContext.SetMySiteHostForContext failed System.UriFormatException: Invalid URI: The URI is empty. 
 at System.Uri.CreateThis(String uriBoolean dontEscapeUriKind uriKind)  

 at Microsoft.Office.Server.Microfeed.SPMicrofeedContext.SetMySiteHostForContext()

Solution

Based on above Error Message, Finally I have realized issue. 
My sites are not loading for the users.
Because Operations team has re-created the User Profile Service and My Site Web App URL was not mapped in the User Profile Service.

The moment I have specified the My site URL in the User Profile Service Properties, web service Started to work and My sites successfully loaded

Cheers

Pre-Upgrade Check List

Download Our Free SharePoint Pre-Upgrade Check List

* indicates required

Vintage Clan

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): The EXECUTE permission - User Profile Issue

How to Create Host Header to SharePoint Web Application

SharePoint 2013 Access Denied in Site Collections in Web Application