<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>SharePoint Escalation Services Team Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/spses/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/spses/feed.xml</link>
    <description />
    <lastBuildDate>Tue, 08 Oct 2019 01:45:07 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>SharePoint 2016 ::  PSConfig execution fails post July 2018  update</title>
      <link>https://docs.microsoft.com/archive/blogs/spses/sharepoint-2016-psconfig-execution-fails-post-july-2018-update</link>
      <pubDate>Thu, 16 Aug 2018 05:03:11 GMT</pubDate>
      <dc:creator><![CDATA[Spses]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spses/?p=2245</guid>
      <description><![CDATA[On a Sharepoint 2016 Farm ,   which has a  Search service application which was created thru...]]></description>
      <content:encoded><![CDATA[On a Sharepoint 2016 Farm ,   which has a  Search service application which was created thru PowerShell &amp; the  Service Account used was other than farm account , Farm upgrade might fail after the  July 10 update for  SharePoint 2016 .

<strong> </strong>After you apply this update (<a href="https://support.microsoft.com/en-in/help/4022228/description-of-the-security-update-for-sharepoint-server-2016">4022228</a>), the PSConfig tool may fail and generate the following error messages:

<strong><em>An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information: </em></strong>

<strong><em>Upgrade [SearchAdminDatabase Name=SEARCH_DB] failed. (EventID:an59t)</em></strong>

<em> </em><strong><em>Exception: The database principal owns a database role and cannot be dropped. The proposed new database owner is already a user or aliased in the database. (EventID:an59t)</em></strong>

<strong><em>Upgrade Timer job is exiting due to exception: System.Data.SqlClient.SqlException (0x80131904): The database principal owns a database role and cannot be dropped. The proposed new database owner is already a user or aliased in the database.</em></strong>

<strong> </strong>

<strong>Cause</strong>

<strong>----------</strong>

To fix a permission issue that is caused by provisioning the Search Service Application with PowerShell, this update (4022228) includes a change to re-link the DBO user to the Farm Service account for the search databases. However, the Farm Service account may already Marked as Owner of  SPSearchDBAdmin  or Any other  database role in the SharePoint Farm. This prevents dropping the account in SQL and causes the PSConfig tool to fail.

In ULS  logs  confirm the  Account  which is being set as Owner of the  database

<strong><em>&lt;Date-Time&gt;        OWSTIMER.EXE (PID)        0x13 SERVERNAME        SharePoint Server        General        en41        High        Changing owner of database 'SQLServer\Instanc1.SSA_Search_CrawlStore' to 'Domain\ServiceAccount'.  </em></strong>

Note: This can  affect any of the  4 Search Databases  of the Search Service application .

&nbsp;

<strong>Workaround</strong>

<strong>-------------------</strong>

To work around this issue, From SQL Management Studio , Review all database roles of  each database of Search SSA &amp; Ensure that  Owner of All roles is “dbo” &amp; not the  Farm Service account  . If this is the case ,  Use following Steps to update
<ol>
 	<li>Double Click the  Role on the Search DB , For eg. SPSearchDBAdmin</li>
 	<li>Set the Owner as dbo role rather than the service account Domain\ServiceAccount as seen in ULS logs accordingly .</li>
</ol>
Then, you can run the PSConfig tool again.

&nbsp;

<strong>Additional Info </strong>

Alternatively the sys.database_role_members Query can be used to Dump All Roles &amp; their memberships of a Database

<span><a href="https://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Frelational-databases%2Fsystem-catalog-views%2Fsys-database-role-members-transact-sql%3Fview%3Dsql-server-2017&amp;data=02%7C01%7C%7C435f332d10cf4290e3d608d6033103b0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636699906750927773&amp;sdata=Cwbu2jmBt70i9EIK1ACIe1l%2Fo2jfhm1sdw8UfVfcL7E%3D&amp;reserved=0">https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-database-role-members-transact-sql?view=sql-server-2017</a></span>

&nbsp;

SELECT DP1.name AS DatabaseRoleName,

isnull (DP2.name, 'No members') AS DatabaseUserName

FROM sys.database_role_members AS DRM

RIGHT OUTER JOIN sys.database_principals AS DP1

ON DRM.role_principal_id = DP1.principal_id

LEFT OUTER JOIN sys.database_principals AS DP2

ON DRM.member_principal_id = DP2.principal_id

WHERE DP1.type = 'R'

ORDER BY DP1.name;

&nbsp;

<strong>Status</strong>

<strong>----------</strong>

Microsoft is aware of this issue. The change has been removed from the August 2018 update, and we are working on permanent fix that will be released in a future update.

&nbsp;

<strong><b>POST BY : Rajan Kapoor [MSFT]</b></strong>]]></content:encoded>
    </item>
    <item>
      <title>Sharepoint 2016 : The CU upgrade fails during PSconfig execution</title>
      <link>https://docs.microsoft.com/archive/blogs/spses/sharepoint-2016-the-cu-upgrade-fails-during-psconfig-execution</link>
      <pubDate>Mon, 26 Mar 2018 05:52:18 GMT</pubDate>
      <dc:creator><![CDATA[Spses]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spses/?p=2225</guid>
      <description><![CDATA[Symptom: 

The SharePoint configuration wizard fails with the following message after the...]]></description>
      <content:encoded><![CDATA[<strong><em>Symptom: </em></strong>

The SharePoint configuration wizard fails with the following message after the installation of CU / Language pack / security patch etc
<pre>Failed to upgrade SharePoint Products.

This is a critical task. You have to fix the failures before you can continue. Follow this link for more information about how to troubleshoot upgrade failures: https://go.microsoft.com/fwlink/?LinkId=259653

An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information:

Feature upgrade action 'CustomUpgradeAction.AddSwitchField' threw an exception upgrading Feature 'CustomTiles' (Id: 15/'68642d38-a556-4384-888c-082844fbf224') in WebApplication 'SharePoint - 80: List |0

Feature upgrade incomplete for Feature 'CustomTiles' (Id: 15/'68642d38-a556-4384-888c-082844fbf224') in WebApplication 'SharePoint - 80. Exception: List |0

Upgrade completed with errors. Review the upgrade log file located in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\LOGS\Upgrade-20180220-162221-353-19435b7e3e40479183e3ca8d9f3155fa.log. The number of errors and warnings is listed

To diagnose the problem, review the application event log and the configuration log file located at:C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\LOGS\PSCDiagnostics_2_20_2018_16_22_10_998_970437191.log

</pre>
The behavior is observed when the web application is created with farm build level <strong>16.0.4456.1000 </strong>

<strong><em>Resolution:</em></strong><strong><em> </em></strong>

The corrective action to perform is to Enable the custom tiles feature to force the creation of the Custom tiles list to move past this road block in running PSConfig.

Enable-spfeature -URL <a href="https://webappurl/">https://webappurl</a> -identity "68642d38-a556-4384-888c-082844fbf224"

&nbsp;

<strong>POST BY : Shiva Prasad [MSFT]</strong>]]></content:encoded>
    </item>
    <item>
      <title>Sharepoint 2013 / 2016 : Migrating User Comments</title>
      <link>https://docs.microsoft.com/archive/blogs/spses/sharepoint-2013-2016-migrating-user-comments</link>
      <pubDate>Wed, 07 Mar 2018 04:29:35 GMT</pubDate>
      <dc:creator><![CDATA[Spses]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spses/?p=2115</guid>
      <description><![CDATA[You might have heard about the OOB webpart 'NoteBoard'. The Note Board is a pretty useful web part...]]></description>
      <content:encoded><![CDATA[You might have heard about the OOB webpart 'NoteBoard'. The Note Board is a pretty useful web part you can add to any page that can take web parts.  It allows you to store comments in the social database against that page using it’s URL – just like the Tags and Notes button in the ribbon. This feature will work as expected when the comments are in the same page (that means same URL). The comments will NOT be visible when you move the content to a different URL , that means if you dismount the DB and mount it again to a different web application with a different URL. A common scenario is : Migrating from Sharepoint 2013 to Sharepoint 2016. Imagine that the Sharepoint 2013 URL is https://sp2013 and the DB is now moved to Sharepoint 2016 web application that has a URL https://sp2016, the comments will NOT be shown ! 

In my test case, I use the URL https://sp2013.contoso.com , where the comments are added to a page "/SitePages/Comments_test.aspx"
<a href="https://msdnshared.blob.core.windows.net/media/2018/03/SP2013Site.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/SP2013Site.jpg" alt="" width="1234" height="643" class="alignleft size-full wp-image-2135" /></a>

I have 4 users added some comments to the page. Lets see how this is saved in the Social Database 
<a href="https://msdnshared.blob.core.windows.net/media/2018/03/SP2013_SQL.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/SP2013_SQL.jpg" alt="" width="1109" height="391" class="alignleft size-full wp-image-2125" /></a>
Note : The Table dbo.urls stores all the URLS where the comments are added and a URLID is associated with it. The same URLID is referenced when saving the comments in the dbo.socialComments table. The field User_recordID refers to the user who added the comments and this information is referred from dbo.userprofile_full table in the corresponding Profile DB. 

Now, lets consider the scenario of migration from SP 2013 to SP2016. The Profile DB and Social DB are migrated to SP2016 and have a User profile service application up and running. The Content Database also migrated to SP2016 , but the comments are not visible as the Social Comments table still contains old URL and it doesn't exists any more. 
<a href="https://msdnshared.blob.core.windows.net/media/2018/03/After_Migration.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/After_Migration.jpg" alt="" width="1248" height="536" class="alignleft size-full wp-image-2145" /></a>

Now, lets execute the following Sharepoint Powershell commands.

<pre><i><b>
Get-SPServiceApplicationProxy #copy the ID of UPA proxy
$upaProxy = Get-SPServiceApplicationProxy 
Move-SPSocialComment -ProfileServiceApplicationProxy $upaProxy -OldUrl "https://sp2013.contoso.com/SitePages/Comments_test.aspx" -NewUrl "https://sp2016.contoso.com/SitePages/Comments_test.aspx"
</b></i></pre>

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/Commands1.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/Commands1.jpg" alt="" width="678" height="459" class="alignleft size-full wp-image-2165" /></a>

Now, the comments appears in the https://sp2016.contoso.com site 
<a href="https://msdnshared.blob.core.windows.net/media/2018/03/After_Command_execution.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/After_Command_execution.jpg" alt="" width="1240" height="624" class="alignleft size-full wp-image-2175" /></a>

Lets see what changed in the Social DB now. 
It creates a new entry in the dbo.urls table with a new URLID and the new URLID is mapped in the dbo.socialcomments table. 
<a href="https://msdnshared.blob.core.windows.net/media/2018/03/after_command_execution_SQL.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/after_command_execution_SQL.jpg" alt="" width="1125" height="435" class="alignleft size-full wp-image-2185" /></a>

You may use this to build a Powreshell script that can innumerate through a list of old and new URLs and replace them if there are multiple URLs to be migrated. 

<strong> <b>POST BY : Manjesh Menon [MSFT]</b></strong>]]></content:encoded>
    </item>
    <item>
      <title>Sharepoint 2016 : Enforcing Retention policy on OneDrive Documents.</title>
      <link>https://docs.microsoft.com/archive/blogs/spses/sharepoint-2016-enforcing-retention-policy-on-onedrive-documents</link>
      <pubDate>Tue, 20 Feb 2018 04:43:16 GMT</pubDate>
      <dc:creator><![CDATA[Spses]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spses/?p=1907</guid>
      <description><![CDATA[You may be familiar with the Information Management Policies that can be used to configure the...]]></description>
      <content:encoded><![CDATA[<p style="margin: 0in;font-family: 'Segoe UI';font-size: 11pt"><span><a href="https://msdnshared.blob.core.windows.net/media/2018/02/Policy_created.jpg"></a>You may be familiar with the Information Management Policies that can be used to configure the retention policy on documents, eg: </span><a href="https://support.office.com/en-us/article/Introduction-to-information-management-policies-63a0b501-ba59-44b7-a35c-999f3be057b2">Introduction to information management policies</a><span> and </span><a href="https://support.office.com/en-us/article/Create-and-apply-information-management-policies-8CCAC9E4-3A50-49FA-A95B-D186032A6EE3">Create and apply information management policies</a><span> . However have you ever wondered who the document retention policies can be applied for the documents within the users's Mysites ? Sharepoint 2016 comes with a new feature called Compliance center and this feature will help us configuring such policies based on the site template used ! </span>Wondering how ? Lets looks at the following steps..</p>
&nbsp;
<p style="padding-left: 30px"><span style="color: #333333;font-family: 'Segoe UI'">Pre-requisites : Configure User profile service application : </span><a href="https://technet.microsoft.com/en-us/library/ee721052(v=office.16).aspx"><span>https://technet.microsoft.com/en-us/library/ee721052(v=office.16).aspx</span></a><span> </span></p>
<p style="padding-left: 30px"><span>Configure </span><span style="color: #333333;font-family: 'Segoe UI'">Mysites : </span><a href="https://technet.microsoft.com/en-us/library/ee624362(v=office.16).aspx"><span style="color: #333333;font-family: 'Segoe UI'">https://technet.microsoft.com/en-us/library/ee624362(v=office.16).aspx</span></a></p>
<p style="padding-left: 30px"><span style="color: #333333;font-family: 'Segoe UI'">Configure Search Service application : </span><a href="https://technet.microsoft.com/en-in/library/gg502597(v=office.16).aspx"><span>https://technet.microsoft.com/en-in/library/gg502597(v=office.16).aspx</span></a></p>
<p style="margin: 0in;color: #333333;font-family: 'Segoe UI';font-size: 11pt">In my test case , the Mysite web app and Mysite host URL is : <a href="https://sp:28309/">https://sp:28309/</a></p>
&nbsp;
<p style="margin: 0in;color: #333333;font-family: 'Segoe UI';font-size: 11pt">Now, lets start the configuration.</p>
&nbsp;
<ol>
 	<li style="margin: 0in;color: #333333;font-family: 'Segoe UI';font-size: 11pt"><span style="font-family: 'Segoe UI';font-size: 11pt;font-style: normal;font-weight: normal"><strong>Create Compliance Policy Center :</strong> </span></li>
</ol>
<p style="margin: 0in 0in 0in 0.375in;color: #333333;font-family: 'Segoe UI';font-size: 11pt">You will need to create a site collection on the same web application as the MysiteHost. The Site template should be selected as "Compliance Policy Center" (Under enterprise templates) . You can use UI method or PowerShell commands to create the site.</p>
<p style="margin: 0in 0in 0in 0.375in;color: #333333;font-family: 'Segoe UI';font-size: 11pt">In My case, the Compliance policy center URL is <a href="https://sp:28309/sites/CompliancePolicyCenter">https://sp:28309/sites/CompliancePolicyCenter</a></p>

<pre> <a href="https://msdnshared.blob.core.windows.net/media/2018/02/Site_template.jpg"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/Site_template.jpg"><img width="516" height="288" class="wp-image-2015 size-full alignnone" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/Site_template.jpg" /></a></pre>
<strong><span style="color: #333333;font-family: 'Segoe UI';font-size: 11pt;font-style: normal">     2. Set the property </span><span style="color: black;font-family: 'Segoe UI';font-size: 11pt;font-style: normal">PolicyCenterUrl for the Mysite web application</span></strong>
<pre>    $webApp=Get-SPwebApplication https://sp:28309
    $webApp.Properties["PolicyCenterUrl"]="https://sp:28309/sites/CompliancePolicyCenter"
    $webApp.update()
    $webApp.Properties</pre>
<span style="font-family: 'Segoe UI';font-size: 11pt;font-style: normal;font-weight: normal">     <strong>3. Access the Compliance Policy center site collection and create a new Deletion policy</strong></span>
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/Create_Deletion_policy_10.jpg"><img width="883" height="334" class="alignleft wp-image-1955" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/Create_Deletion_policy_10.jpg" /></a></pre>
<strong>     4. Create a new Rule</strong>
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/Create_Delete_rule.jpg"><img width="780" height="299" class="alignleft wp-image-1935" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/Create_Delete_rule.jpg" />

</a></pre>
Provide the policy Name and then create a new Rule - You can choose the option to delete the files permanently or move them to recycble and options are available to rule for "created date" and "Modified date" , number of days etc.
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/Create_Delete_rule1.jpg"><img width="578" height="365" class="alignleft wp-image-1945" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/Create_Delete_rule1.jpg" /></a></pre>
Now the Policy and rule will look like below
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/Policy_created.jpg"><img width="652" height="356" class="alignleft wp-image-1975" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/Policy_created.jpg" /></a></pre>
&nbsp;

<strong>     5. Assign the Compliance policy to a site template</strong>
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/Template1.jpg"><img width="715" height="215" class="alignleft wp-image-2055" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/Template1.jpg" /></a> <a href="https://msdnshared.blob.core.windows.net/media/2018/02/Template2.jpg"><img width="591" height="331" class="alignleft wp-image-2065" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/Template2.jpg" /></a></pre>
Once the template is selected click on "Manage Assigned Policies" and select the policy.
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/template4.jpg"><img width="559" height="367" class="alignleft wp-image-2085" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/template4.jpg" /></a> <a href="https://msdnshared.blob.core.windows.net/media/2018/02/Template5.jpg"><img width="609" height="280" class="alignleft wp-image-2095" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/Template5.jpg" /></a></pre>
You will see it as below - Make sure that you select "Mark Policy as Mandatory"
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/template3.jpg"><img width="685" height="421" class="alignleft wp-image-2075" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/template3.jpg" /></a></pre>
<strong>     6. Confirm that the policy is applied using the following URL from the site collection level </strong>
https://sp:28309/personal/contoso_administrator/_layouts/15/retentionpolicyCollectionAdminsettings.aspx
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/RetentionPolicyCollectionAdminsettings.jpg"><img width="677" height="232" class="alignleft wp-image-1995" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/RetentionPolicyCollectionAdminsettings.jpg" /></a></pre>
https://sp:28309/personal/contoso_administrator/_layouts/15/retentionpolicyadminsettings.aspx
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/retentionpolicyadminsettings.jpg"><img width="605" height="330" class="alignleft wp-image-1985" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/retentionpolicyadminsettings.jpg" /></a></pre>
<b>Nice..We are done with the basic setup.. :-)</b>

Now, I have a OneDriveForBusiness site for the user Contoso\spfarm and a document is created / uploaded which is now 8 days old. We will proceed with removing this file from the document library using the policy we created and set. Document : Upgrade-20171022-081946-944.log
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/Sample-document-1.jpg"><img width="980" height="294" class="alignleft size-full wp-image-2005" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/Sample-document-1.jpg" /></a></pre>
<strong>     7. Crawl the Document</strong>
This document should be crawled and indexed by the associated search service application. If this item is NOT crawled or indexing failed for some reason , fix it. You can confirm it by issuing a search for the document
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/search-1.jpg"><img width="508" height="363" class="alignleft wp-image-2006" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/search-1.jpg" /></a></pre>
<strong>      8. GET and SET ip_lastcompliancepolicyprocesstime property</strong>
Now confirm that The ip_lastcompliancepolicyprocesstime property for the mysite web should be atleast 7 days behind from current day
<pre><b><i>To check the property value</i></b>
    $web=Get-spweb https://sp:28309/personal/contoso_spfarm/
    $web.AllProperties["ip_lastcompliancepolicyprocesstime”]
</pre>
<pre><b><i>To reset the value to an older date: (Execute this only if the value shows within 7 days from today) </i></b>
    $web=Get-spweb https://sp:28309/personal/contoso_spfarm/
    $ResetDate=(Get-date).AddDays(-10)
    $modifieddate=(Get-date $ResetDate -Format "MM/dd/yyyy hh:mm:ss tt")
    $Updatedate= (Get-Date $modifieddate).ToString("MM/dd/yyyy hh:mm:ss tt")
    $web.AllProperties["ip_lastcompliancepolicyprocesstime”]=$Updatedate
    $web.update()
    $web.AllProperties["ip_lastcompliancepolicyprocesstime”]
</pre>
<strong>      9. Execute the Timer jobs </strong>
You can now execute the following Timer jobs in the same order mentioned - Make sure that you pick the right web application
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/jobs.jpg"><img width="957" height="83" class="alignleft size-full wp-image-1965" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/jobs.jpg" /></a></pre>
When the <i>Compliance Dar Task house keeping job </i> is executed , you can see a task getting created in the "Dar Tasks" list in the compliance center site.
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/task-1.jpg"><img width="892" height="371" class="alignleft wp-image-2025" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/task-1.jpg" /></a></pre>
Executing the <i>Compliance Dar processing job </i> will create a few more items
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/task-2.jpg"><img width="888" height="450" class="alignleft wp-image-2035" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/task-2.jpg" /></a></pre>
Execute the <i>Compliance Policy processing job </i> , you may not see a difference in the number of items in the "Dar Tasks" lists , but a few updates like Task completion time will be updated.
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/task-3.png"><img width="886" height="414" class="alignleft wp-image-2045" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/task-3.png" /></a></pre>
<strong>     10. Done .. ! Test it now </strong>
Now Access the OneDrive for business for contoso_spfarm and the item is completely removed.
<pre><a href="https://msdnshared.blob.core.windows.net/media/2018/02/completion.jpg"><img width="887" height="285" class="alignleft wp-image-1925" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/completion.jpg" /></a></pre>
<b>Critical Points to remember - </b>
<table style="width: 100%" border="1">
<tbody>
<tr>
<td><b>1</b>. ALL the web applications in the farm should have a property PolicyCenterUrl set with the right URL - <strong><span style="color: #ff6600">NOT</span></strong> just the Mysitehost web app
<b>2</b>. The contents of the Mysite web application should be successfully crawled and indexed
<b>3</b>. The ip_lastcompliancepolicyprocesstime property for <strong><span style="color: #ff6600">each</span></strong> OneDriveforBusiness site should be atleast 7 days behind from current day
<b>4</b>. The Timer jobs “Compliance Dar Tasks housekeeping”, “Compliance Dar processing” and “Compliance Policy processing” should be executed in the same order.</td>
</tr>
</tbody>
</table>
&nbsp;

A sample PowerShell script is shared herewith to automate step 2,3 and 4. Make sure that you have the right values for $MysiteWebApp and $PolicySiteCollection variables.

<span style="color: #ff0000"># Code Disclaimer:</span>
<span style="color: #ff0000"> # Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code, provided that. You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.</span>
#*=============================================
<pre>$MysiteWebApp ="https://sp:28309"
$PolicySiteCollection="https://sp:28309/sites/CompliancePolicyCenter"

$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null)
{
Write-Host "Loading SharePoint Powershell Snapin" -ForegroundColor Green
Add-PSSnapin "Microsoft.SharePoint.Powershell"
}

$WebApp=get-spwebapplication $MysiteWebApp
$sites = $WebApp.sites
$Policyweb=get-spweb $PolicySiteCollection
$Darlist=$policyweb.lists["Dar Tasks"]

Write-host "Running History cleanup.." -ForegroundColor Yellow

foreach($item in $Darlist.Items)
{
$Darlist.getitembyid($item.id).delete()
}
Write-host "Finished History cleanup.." -ForegroundColor Green
write-host " "

Write-host "Setting the Web property value.. This may take more time depending on the number of mysites you have. " -ForegroundColor Yellow
write-host "****************************************"
foreach ($site in $sites)
{
$web=Get-spweb $site.url

if ($site.url -match "/personal/")
{
$ResetDate=(Get-date).AddDays(-10)
$modifieddate=(Get-date $ResetDate -Format "MM/dd/yyyy hh:mm:ss tt")
$Updatedate= (Get-Date $modifieddate).ToString("MM/dd/yyyy hh:mm:ss tt")
$web.AllProperties["ip_lastcompliancepolicyprocesstime”]=$Updatedate
write-host "Web URL : " $site.url -foregroundcolor magenta
write-host "Property value : " $web.AllProperties["ip_lastcompliancepolicyprocesstime”]-foregroundcolor magenta
write-host " "
$web.Update()
}
}

write-host "****************************************"
Write-host "Setting the Web property value completed. " -ForegroundColor Green
write-host " "

Write-host "Executing the Dar Tasks House Keeping Job" -ForegroundColor Yellow
$HouseKeepingJob=Get-SPTimerJob | where {$_.typename -eq "Microsoft.Office.CompliancePolicy.SharePoint.Internal.DarTaskHouseKeepingJobDefinition" -and $_.webapplication -match "Mysite"}
$HouseKeepingJob.RunNow()
sleep 60
write-host "Completed..." -ForegroundColor Green
write-host " "

Write-host "Executing the Dar Processing Job" -ForegroundColor Yellow
$DarprocessingJob=Get-SPTimerJob | where {$_.typename -eq "Microsoft.Office.CompliancePolicy.SharePoint.Internal.DarProcessingJobDefinition" -and $_.webapplication -match "Mysite"}
$DarprocessingJob.runNow()
Sleep 60
write-host "Completed..." -ForegroundColor Green
write-host " "

Write-host "Executing the Compliance Policy Processing Job" -ForegroundColor Yellow
$ComplianPolicyProcessingJob=Get-SPTimerJob | where {$_.typename -eq "Microsoft.Office.CompliancePolicy.SharePoint.Internal.PolicyProcessingJobDefinition" -and $_.webapplication -match "Mysite"}
$ComplianPolicyProcessingJob.RunNow()
Sleep 60
write-host "Completed..." -ForegroundColor Green
</pre>
<br>
<strong> <b>POST BY : Manjesh Menon [MSFT]</b></strong>]]></content:encoded>
    </item>
    <item>
      <title>Sharepoint 2013 : Information Management policy not working</title>
      <link>https://docs.microsoft.com/archive/blogs/spses/sharepoint-2013-information-management-policy-not-working</link>
      <pubDate>Thu, 21 Dec 2017 02:51:12 GMT</pubDate>
      <dc:creator><![CDATA[Spses]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spses/?p=1886</guid>
      <description><![CDATA[Here is one of the interesting scenarios that we worked recently , where Information Management...]]></description>
      <content:encoded><![CDATA[<span style="color: #000000"><span style="font-family: 'Verdana',sans-serif;font-size: 10pt">Here is one of the interesting scenarios that we worked recently , where Information Management policy not working on all the record template based document libraries within a specific site collection / content database. The documents that are meeting the policy ,were not getting removed automatically from a specific site collection while </span><span style="font-family: 'Verdana',sans-serif;font-size: 10pt">the same policy works on other site collections within the same content database.</span></span>

Before taking a deep dive on the troubleshooting steps , here is the definition of IM policy.

<span style="font-size: 10pt"><strong><span style="color: #000000;font-family: 'Verdana',sans-serif">What is IM policy?</span></strong></span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">An information management policy is a set of rules for a type of content. Information management policies enable organizations to control and track things like how long content is retained or what actions users can take with that content. Information management policies can help organizations comply with legal or governmental regulations, or they can simply enforce internal business processes.</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">One of the feature is Retention policy feature which lets you define retention stages, with an action that happens at the end of each stage.</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">Below two links explain this feature in detail.</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt"><a href="https://support.office.com/en-us/article/Introduction-to-information-management-policies-63a0b501-ba59-44b7-a35c-999f3be057b2">https://support.office.com/en-us/article/Introduction-to-information-management-policies-63a0b501-ba59-44b7-a35c-999f3be057b2</a> </span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt"><a href="https://technet.microsoft.com/en-us/library/cc262490.aspx">https://technet.microsoft.com/en-us/library/cc262490.aspx</a></span>

&nbsp;

<span style="color: #000000">Ok, now lets come back to the troubleshooting aspects.</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">The size of the content database in question was about 650GB in size with about 100+ site collections in it. Database maintenance was in place and getting done on a regular basis.</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">Confirmed that the site feature LocationBasedPolicy activated at site collection level using the following </span>
<pre><span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">$site = Get-SPSite <a href="https://sp2:10150/sites/recordcentertest">https://sp/sites/recordcentertest</a></span>
<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">$site.Features["063c26fa-3ccc-4180-8a84-b6f98e991df3"]</span>
</pre>
&nbsp;

<span style="color: #000000"><span style="font-family: 'Verdana',sans-serif;font-size: 10pt">1. Confirmed that "Send To" option from Central Admin associated with non-working library works fine.</span></span>

<span style="color: #000000"><span style="font-family: 'Verdana',sans-serif;font-size: 10pt"> </span><span style="font-family: 'Verdana',sans-serif;font-size: 10pt">When retention policies are applied on content types, there are 2 timer jobs that run (by default during the weekend) associated with web application:</span></span>

<span style="color: #000000"><span style="font-family: 'Verdana',sans-serif;font-size: 10pt"> </span><span style="font-family: 'Verdana',sans-serif;font-size: 10pt">•<strong>Information management policy timer job:</strong> </span></span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">             <em>by default, runs on Friday 11 PM. The job goes through libraries that have policies applied. </em></span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt"><em>             It calculates the expiration date for every item</em></span>

<span style="color: #000000"><span style="font-family: 'Verdana',sans-serif;font-size: 10pt"> </span><span style="font-family: 'Verdana',sans-serif;font-size: 10pt">•<strong>Expiration policy timer job:</strong> </span></span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">             <em>by default, runs on Saturday 11 PM. This job executes the action part of the retention policy. </em></span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt"><em>             For example, if the action is to move expired documents </em></span><span style="color: #000000;font-size: 10pt"><em><span style="font-family: 'Verdana',sans-serif">to the recycle bin, expired documents will be deleted; </span></em></span>

<span style="color: #000000;font-size: 10pt"><em><span style="font-family: 'Verdana',sans-serif">             if the action is set to move the documents to a send-to location, the expired documents will be moved.</span></em></span>

<span style="color: #000000"><span style="font-family: 'Verdana',sans-serif;font-size: 10pt"> </span><span style="font-family: 'Verdana',sans-serif;font-size: 10pt"><strong>Get-SPTimerJob | ?{$_.name -eq 'PolicyUpdateProcessing'} | Select Name, Schedule, LastRunTime, Id, WebApplication, IsDisabled</strong> </span></span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">should help us get the timer job listing associated with web application.</span>

&nbsp;

<span style="color: #000000"><span style="font-family: 'Verdana',sans-serif;font-size: 10pt">2. In the logs collected while running the timer job, we should see messages like below</span></span>
<table width="850" border="1">
<tbody>
<tr>
<td width="270"><span style="color: #000000">OWSTIMER.EXE (0x0D90)</span></td>
<td width="50"><span style="color: #000000">0x1070</span></td>
<td width="482"><span style="color: #000000">Document Management Server</span></td>
<td width="236"><span style="color: #000000">Information Policy Management</span></td>
<td width="90"><span style="color: #000000">aap0</span></td>
<td width="74"><span style="color: #000000">Medium</span></td>
<td width="705"><span style="color: #000000">Policy Update: Processing policy updates for list TestDocForMoving on web https://sp/sites/RecordsCenterTest.</span></td>
</tr>
</tbody>
</table>
<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">Since the library was not mentioned anywhere in the logs collected from the environment, compared the working and non-working libraries to check if there is a difference in schema.</span>

<span style="color: #000000"><span style="font-family: 'Verdana',sans-serif;font-size: 10pt"> </span><span style="font-family: 'Verdana',sans-serif;font-size: 10pt">A library with active retention policies should have the following hidden fields:</span></span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">_dlc_Exempt</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">_dlc_ExpireDateSaved</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">_dlc_ExpireDate</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt"> </span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">Run the below command-lets on one of the working libraries and non-working one as well</span>
<pre><span style="color: #000000"><span style="font-family: 'Verdana',sans-serif;font-size: 10pt">$site = get-spsite <a href="https://sp2:10150/sites/RecordsCenterTest">https://sp/sites/RecordsCenterTest</a>      //Change it to your site collection url</span></span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">$web = get-spweb <a href="https://sp2:10150/sites/RecordsCenterTest">https://sp/sites/RecordsCenterTest</a>    //Change it to your site collection url</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">$list = $web.lists["TestDocForMoving"]                        // Change it to your library name</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">$list &gt; C:\listschema.txt                                            //Change the filename accordingly</span>
</pre>
<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">Compare the schema and confirm if “_dlc_ExpireDateSaved” and “_dlc_ExpireDate” fields missing in value.</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">To confirm ran the below for all 3 fields and make sure that the results are NULL</span>
<pre><span style="color: #000000"><span style="font-family: 'Verdana',sans-serif;font-size: 10pt">$web=Get-SPWeb <a href="https://sp:90/sites/Test/subsite">https://sp:90/sites/Test/subsite</a></span></span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">$list = $web.Lists['Listname']</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">$ct2=$list.ContentTypes['contenttype name']</span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">$ct2.Fields | ?{$_.internalname -match '_dlc_ExpireDate'}</span>
</pre>
&nbsp;

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">To resolve the issue, there are 2 options available to us</span><span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt"> </span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt"><strong>A.</strong> Try de-attaching and attaching the content database which hosts the site collection</span>

<span style="color: #ff0000"><strong>     Caution:</strong></span> This step will make other sites in the content DB to be unavailable until the DB is reattached.
If you have Project server instance (PWA sites within the Content DB) , we recommend NOT to proceed with option A

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt"><strong>B.</strong> Using move-spsite command, move the site collection to another content database </span>

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt">    Refer: <a href="https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/move-spsite?view=sharepoint-ps">https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/move-spsite?view=sharepoint-ps</a></span>

&nbsp;

&nbsp;

<span style="color: #000000;font-family: 'Verdana',sans-serif;font-size: 10pt"> <strong>POST BY : Revathi K [MSFT]</strong></span>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013 - How to crawl IIS Virtual Directories created under SharePoint Web application</title>
      <link>https://docs.microsoft.com/archive/blogs/spses/sharepoint-2013-how-to-crawl-iis-virtual-directories-created-under-sharepoint-web-application</link>
      <pubDate>Wed, 13 Dec 2017 02:18:38 GMT</pubDate>
      <dc:creator><![CDATA[Spses]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spses/?p=1816</guid>
      <description><![CDATA[We have recently come across a scenario where one of our customers is unable to crawl the contents...]]></description>
      <content:encoded><![CDATA[We have recently come across a scenario where one of our customers is unable to crawl the contents of a virtual directory that's created under the Sharepoint web application . This blog post will talk about how to configure Sharepoint Search to crawl files of a virtual directory.

Lets consider the below as example:

<span style="color: #000000;font-family: Calibri">SharePoint Web application URL: </span><a href="https://sp2103:4141/">https://sp2103:4141/</a><span style="color: #000000;font-family: Calibri"> </span>

<span style="color: #000000;font-family: Calibri">Virtual Directory URL: </span><a href="https://sp2103:4141/test">https://sp2103:4141/test</a><span style="color: #000000;font-family: Calibri"> </span>

By default, when you configure Sharepoint search , the Sharepoint site <a href="https://sp2103:4141/">https://sp2103:4141/</a> will be crawled using the "Local Sharepoint Sites" Content source. To crawl the virtual directory , if a new content source is created with start address as <a href="https://sp2103:4141/Test/">https://sp2103:4141/Test/</a> , it may not crawl the contents of the Virtual directory , but trigger another Sharepoint crawl on the start address <a href="https://sp2013:4141/">https://sp2013:4141/</a>.

&nbsp;

Lets see how we can achieve this - The first and foremost , you need some content within the Virtual directory. So lets create a few sample HTML /ASPX files

<a href="https://msdnshared.blob.core.windows.net/media/2017/12/Ajay_virtualdir_search_one.jpg"><img width="624" height="284" class="alignleft size-full wp-image-1846" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/12/Ajay_virtualdir_search_one.jpg" /></a>

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

Then, follow the 3 steps mentioned below

<strong>1) Create a new content source.</strong>

Start Address: https://sp2013:4141/test

Content Source Type- Web site

Only crawl the first page of each start address.

<a href="https://msdnshared.blob.core.windows.net/media/2017/12/Ajay_virtualdir_search_two.jpg"><img width="465" height="406" class="alignleft wp-image-1865" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/12/Ajay_virtualdir_search_two.jpg" /></a>

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

<strong>2) Create Crawl rule as below</strong>

Path: <a href="https://sp2013:4141/test/*">https://sp2013:4141/test/*</a>

Crawl SharePoint content as http pages

The crawls to <a href="https://sp2013:4141/test/*">https://sp2013:4141/test/*</a> would be website (non-Sharepoint) crawls.

To discover other pages we need links embedded in the index page “default.aspx”.

<a href="https://msdnshared.blob.core.windows.net/media/2017/12/Ajay_virtualdir_search_three.jpg"><img width="417" height="300" class="alignleft wp-image-1855" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/12/Ajay_virtualdir_search_three.jpg" /></a>

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

<strong>3) Do full crawl on the new content source.</strong>

Now only the items under the virtual directory is crawled.

<a href="https://msdnshared.blob.core.windows.net/media/2017/12/Ajay_virtualdir_search_four.jpg"><img width="458" height="171" class="alignleft size-full wp-image-1845" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/12/Ajay_virtualdir_search_four.jpg" /></a>

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

<span style="color: #333333;text-indent: 0px;letter-spacing: normal;font-family: 'Segoe UI', Tahoma, Arial, 'Helvetica Neue', Helvetica, sans-serif;font-size: 14px;font-style: normal;font-weight: 400;text-decoration: underline;background-color: #ffffff"><strong>WARNING:</strong></span><span style="color: #333333;text-indent: 0px;letter-spacing: normal;font-family: 'Segoe UI', Tahoma, Arial, 'Helvetica Neue', Helvetica, sans-serif;font-size: 14px;font-style: normal;font-weight: 400;float: none;background-color: #ffffff"><span> </span>Its highly recommended <em><span style="text-decoration: underline"><strong>NOT</strong> </span></em>to modify the settings of IIS website created by Sharepoint. A proper back up of the Site / files along with a good documentation of your IIS settings will be useful in case disaster recovery scenario arises. </span>

&nbsp;

<strong>POST BY : Ajay Xavier [MSFT]</strong>]]></content:encoded>
    </item>
    <item>
      <title>High Trust provider Apps (On-Premise environment) won’t publish when Azure App Proxy enabled in web application service application proxy Association</title>
      <link>https://docs.microsoft.com/archive/blogs/spses/high-trust-provider-apps-on-premise-environment-wont-publish-when-azure-app-proxy-enabled-in-web-application-service-application-proxy-association</link>
      <pubDate>Mon, 06 Nov 2017 02:32:20 GMT</pubDate>
      <dc:creator><![CDATA[Spses]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spses/?p=1805</guid>
      <description><![CDATA[Symptom:

High Trust provider Apps (On-Premise environment) won’t publish when Azure App Proxy...]]></description>
      <content:encoded><![CDATA[<strong>Symptom:</strong>

High Trust provider Apps (On-Premise environment) won’t publish when Azure App Proxy enabled in web application service application proxy Association

A high trust app (aka S2S, for Server-To-Server) is for on-premise environment and not intended for cloud-hosted environment. Apps that use S2S would typically be installed behind the firewall in instances that is specific to an individual company. A High trust app is allowed to perform any actions it has been granted permissions to, regardless of the user's permission.

To configure the trust for these apps, you can follow the steps mentioned in article<span> <a href="https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/create-high-trust-sharepoint-add-ins">Create high-trust SharePoint Add-ins</a></span>.

There could be some instances where you have Hybrid configured in your on-premise environment which is done using <strong>Azure Service application proxy</strong>. In this scenario, while trying to install any high trusted app in SharePoint on-premise site collection, we get the error message <strong>“Sorry, something went wrong with adding the app. Click to retry". </strong>

When you check the ULS Logs, you will find error message as below where it complains about validating access token.

&nbsp;
<table width="70%" border="1">
<tbody>
<tr>
<td>OWSTIMER.EXE</td>
<td>SharePoint Foundation</td>
<td>App Deployment</td>
<td>M6uw</td>
<td>High</td>
<td>App Packaging: Create SPAppPart : the app part relationship: <a href="https://schemas.microsoft.com/sharepoint/2012/app/relationships/content-resource">https://schemas.microsoft.com/sharepoint/2012/app/relationships/content-resource </a>

is not recognized, skipping.</td>
</tr>
<tr>
<td>OWSTIMER.EXE</td>
<td>SharePoint Foundation</td>
<td>App Deployment</td>
<td>ajlc1</td>
<td>High</td>
<td>Error when try to get access token when deploy

AppInstanceId &lt;AppInstnceID&gt; with AppPrincipalId &lt;AppPrincipalID&gt;

Exception=<b>System.ArgumentNullException</b>: <b>Value cannot be null</b>.

<b>                    Parameter name: applicationRealm </b>

at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForApplicationContext

(SPIdentityContext userIdentityContext, String applicationId,

Uri applicationRealm, SPApplicationContextAccessTokenType

applicationTokenType, SPApplicationDelegationConsentType consentValue)

&nbsp;

at Microsoft.SharePoint.SPServerToAppServerAccessTokenManager.

GetAccessTokenForDeploymentTask(Guid siteId, SPUserToken userToken,

String appPrincipalId)

&nbsp;

at Microsoft.SharePoint.Lifecycle.SPAppPrincipalAccessTokenTask.&lt;&gt;c__DisplayClass1.

&lt;Deploy&gt;b__0()</td>
</tr>
</tbody>
</table>
<strong><u> </u></strong>

<strong>Cause:<u> </u></strong>

This happens because it is trying to validate the app principal access token at cloud or Azure proxy level. Since we are creating a high-trust app for on-premises use, we must disable access token check that is related to cloud-hosted app, which is not needed for high-trust apps.

<strong> </strong><strong>Resolution:<u> </u></strong>

Backup and add the following register key AppDeploymentCheckAppPrincipalAccessToken in SharePoint servers at [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\WSS] with value REG_DWORD 0x00000000 (0)

<a href="https://msdnshared.blob.core.windows.net/media/2017/11/app.jpg"><img width="590" height="326" class="alignleft size-full wp-image-1815" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/11/app.jpg" /></a>

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

<span style="text-decoration: underline"><strong>WARNING:</strong></span> Using Registry Editor incorrectly can cause serious problems that may require you to reinstall / reconfigure Windows or Sharepoint. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base: <span><a href="https://support.microsoft.com/en-us/help/322756" id="kb-link-2">322756 </a> How to back up and restore the registry in Windows</span>

References : <span><a href="https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/create-high-trust-sharepoint-add-ins">Create high-trust SharePoint Add-ins</a></span>

<span><a href="https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/create-and-use-access-tokens-in-provider-hosted-high-trust-sharepoint-add-ins">Create and use access tokens in provider-hosted high-trust SharePoint Add-ins</a></span>

<span><a href="https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/troubleshooting-high-trust-sharepoint-add-ins">Troubleshooting high-trust SharePoint Add-ins</a></span>

<span><a href="https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/creating-sharepoint-add-ins-that-use-high-trust-authorization">Creating SharePoint Add-ins that use high-trust authorization</a></span>

&nbsp;

<strong>POST BY : Goldi Agrawal [MSFT]</strong>]]></content:encoded>
    </item>
    <item>
      <title>Sharepoint 2016 : REST API Calls fail with error Column doesnot exists</title>
      <link>https://docs.microsoft.com/archive/blogs/spses/sharepoint-2016-rest-api-calls-fail-with-error-column-doesnot-exists</link>
      <pubDate>Thu, 05 Oct 2017 10:18:23 GMT</pubDate>
      <dc:creator><![CDATA[Spses]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spses/?p=1756</guid>
      <description><![CDATA[Symptom : Rest API call fails when first character of column starts with underscore...]]></description>
      <content:encoded><![CDATA[<span style="color: #000000;font-family: Calibri"><strong>Symptom :</strong> Rest API call fails when first character of column starts with underscore “_”</span>

<a href="https://sp2016/_api/web/lists/getbytitle('Documents')/items/?$select=OData__Enddate">https://sp2016/_api/web/lists/getbytitle('Documents')/items/?$select=_Enddate</a>

Using Internet explorer , we can see the response as 400 Bad request

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/IE-400.jpg"><img width="822" height="467" class="alignleft wp-image-1776" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/IE-400.jpg" />
</a>

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

You may see a different error message when the same URL is accessed using a non-IE browser.

eg:

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/Chrome.jpg"><img width="782" height="315" class="alignleft wp-image-1766" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/Chrome.jpg" /></a>

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

The corresponding SharePoint ULS shows the following stack
<table width="850" bgcolor="#dcdcdc" border="1">
<tbody>
<tr>
<td width="623">Exception occured in scope Microsoft.SharePoint.SPListItemEntityCollection<strong>._SerializeToOData.</strong> Exception=Microsoft.SharePoint.SPException: Column <strong>'_EndDate' does not exist</strong>. It may have been deleted by another user.

at Microsoft.SharePoint.SPListItemEntityCollectionCamlQueryBuilder.SetFieldRef(XmlWriter writer, String fieldPath, FieldRefUsage fieldRefUsage, Action`1 attributeAction)

at Microsoft.SharePoint.SPListItemEntityCollectionCamlQueryBuilderUtilities.SetWhereBinaryOp[T](XmlWriter writer, EdmParserNode parseNode, SetFieldRefDelegate`1 setFieldRef, SetValueDelegate`1 setValue, GetConvertedValueDelegate getConvertedValue)

at Microsoft.SharePoint.SPListItemEntityCollectionCamlQueryBuilderUtilities.SetWhereInternal[T](XmlWriter writer, EdmParserNode parseNode, SetFieldRefDelegate`1 setFieldRef, SetValueDelegate`1 setValue, GetConvertedValueDelegate getConvertedValue)

at Microsoft.SharePoint.SPListItemEntityCollectionCamlQueryBuilderUtilities.SetWhereBinaryOp[T](XmlWriter writer, EdmParserNode parseNode, SetFieldRefDelegate`1 setFieldRef, SetValueDelegate`1 setValue, GetConvertedValueDelegate getConvertedValue)

at Microsoft.SharePoint.SPListItemEntityCollectionCamlQueryBuilderUtilities.SetWhereInternal[T](XmlWriter writer, EdmParserNode parseNode, SetFieldRefDelegate`1 setFieldRef, SetValueDelegate`1 setValue, GetConvertedValueDelegate getConvertedValue)

at Microsoft.SharePoint.SPListItemEntityCollectionCamlQueryBuilderUtilities.SetWhere[T](XmlWriter writer, EdmParserNode parseNode, SetFieldRefDelegate`1 setFieldRef, SetValueDelegate`1 setValue, GetConvertedValueDelegate getConvertedValue)

at Microsoft.SharePoint.SPListItemEntityCollectionCamlQueryBuilder.SetViewQuery(SPQuery query, XmlWriter writer, StringBuilder sb)

at Microsoft.SharePoint.SPListItemEntityCollectionCamlQueryBuilder.BuildCamlQuery()

at Microsoft.SharePoint.SPListItemEntityCollectionCamlQueryBuilder..ctor(SPList list, RESTfulQuery restQuery, Nullable`1 itemId)

at Microsoft.SharePoint.SPListItemEntityCollectionQuery..ctor(SPList list, RESTfulQuery restQuery, Nullable`1 itemId)

at Microsoft.SharePoint.SPListItemEntityCollection.TryWriteAsOData(ServerStub serverStub, ODataWriter writer, RESTfulQuery query, ProxyContext proxyContext)

at Microsoft.SharePoint.Client.ServerStub.Write(Object value, Uri path, ODataWriter writer, RESTfulQuery query, ProxyContext proxyContext)</td>
</tr>
</tbody>
</table>
&nbsp;

<strong>Cause /Reason:</strong>

This is a limitation of OData protocol which does not allow “_” to be the first character. Therefore, SharePoint prefixes OData_ to the internal name, if the field name starts with an underscore and workaround is to do the same manually in our rest api query.

<strong>Workaround:</strong>

Prefix OData_ manually in the rest api query

The sample query will look like following <a href="https://sp2016/_api/web/lists/getbytitle('Documents')/items/?$select=OData__Enddate">https://sp2016/_api/web/lists/getbytitle('Documents')/items/?$select=OData__Enddate</a>

Note: There are 2 underscores in above query <em><strong>OData__Enddate</strong></em>

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/IE-working.jpg"><img width="805" height="370" class="alignleft wp-image-1786" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/IE-working.jpg" /></a>

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

<span style="color: #000000;font-family: Calibri"><strong>Note :</strong> Some of the OOB columns which starts with underscore and rest call to them fails</span>
<table width="246" border="1">
<tbody>
<tr>
<td width="246">_DCDateModified</td>
</tr>
<tr>
<td>_Author</td>
</tr>
<tr>
<td>_dlc_Exempt</td>
</tr>
<tr>
<td>_Level</td>
</tr>
<tr>
<td>_Enddate</td>
</tr>
<tr>
<td>_UIVersionString</td>
</tr>
<tr>
<td>_vti_ItemDeclaredRecord</td>
</tr>
<tr>
<td>_dlc_DocId</td>
</tr>
<tr>
<td>_EditMenuTableStart2</td>
</tr>
<tr>
<td>_UIVersion</td>
</tr>
<tr>
<td>_Status</td>
</tr>
<tr>
<td>_dlc_DocIdUrl</td>
</tr>
<tr>
<td>_EndDate</td>
</tr>
<tr>
<td>_Relation</td>
</tr>
<tr>
<td>_Identifier</td>
</tr>
<tr>
<td>_HasCopyDestinations</td>
</tr>
<tr>
<td>_CopySource</td>
</tr>
<tr>
<td>_ResourceType</td>
</tr>
<tr>
<td>_CheckinComment</td>
</tr>
<tr>
<td>_Contributor</td>
</tr>
<tr>
<td>_dlc_DocIdPersistId</td>
</tr>
<tr>
<td>_dlc_ExpireDateSaved</td>
</tr>
<tr>
<td>_Revision</td>
</tr>
<tr>
<td>_SourceUrl</td>
</tr>
<tr>
<td>_Photo</td>
</tr>
<tr>
<td>_Publisher</td>
</tr>
<tr>
<td>_Version</td>
</tr>
<tr>
<td>_EditMenuTableStart</td>
</tr>
<tr>
<td>_Coverage</td>
</tr>
<tr>
<td>_Comments</td>
</tr>
<tr>
<td>_LastPrinted</td>
</tr>
<tr>
<td>_vti_ItemHoldRecordStatus</td>
</tr>
<tr>
<td>_RightsManagement</td>
</tr>
<tr>
<td>_Category</td>
</tr>
<tr>
<td>_Source</td>
</tr>
<tr>
<td>_Format</td>
</tr>
<tr>
<td>_dlc_ExpireDate</td>
</tr>
<tr>
<td>_DCDateCreated</td>
</tr>
<tr>
<td>_vti_ItemIsLocked</td>
</tr>
<tr>
<td>_IsCurrentVersion</td>
</tr>
<tr>
<td>_SharedFileIndex</td>
</tr>
<tr>
<td>_ModerationComments</td>
</tr>
<tr>
<td>_ModerationStatus</td>
</tr>
<tr>
<td>_EditMenuTableEnd</td>
</tr>
</tbody>
</table>
&nbsp;

<strong>POST By : Brijesh Poddar [MSFT]</strong>]]></content:encoded>
    </item>
    <item>
      <title>Sharepoint 2016 : Changes to default DaysToKeepUsageFile value</title>
      <link>https://docs.microsoft.com/archive/blogs/spses/sharepoint-2016-change-to-default-daystokeepusagefile-value</link>
      <pubDate>Wed, 23 Aug 2017 02:55:33 GMT</pubDate>
      <dc:creator><![CDATA[Spses]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spses/?p=1755</guid>
      <description><![CDATA[The Requestusage folder at C:\Program Files\Common Files\microsoft shared\Web Server...]]></description>
      <content:encoded><![CDATA[The <strong>Requestusage</strong> folder at <strong>C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\LOGS\</strong> keeps the Page request data and are processed by the Timer job <strong>"Microsoft SharePoint Foundation Usage Data Processing "</strong> . The files will be cleared from the above mentioned location once its processed so that the disk space will not be consumed much. However with Sharepoint 2016 , it is noticed that the usage files are not getting cleared from the location even after the successful execution of the Timer job, this in turn causes the disk to be filled up.

Up on investigation , we found that the default DaysTokeepUsagefile value is 5 in SharePoint 2016, while the value of this property is 0 (Zero) in Sharepoint 2013 that means the data will be preserved on the disk for 5 days by default.

The below Powershell command will help you determine the current value set of DaysToKeepUsageFile

<strong>Get-SPUsageDefinition -Identity "Page Requests" | fl</strong>
<table border="1">
<tbody>
<tr>
<td>TableName</td>
<td>  RequestUsage</td>
</tr>
<tr>
<td>UrlTypeFilter</td>
<td>  {js, css, jpg, gif...}</td>
</tr>
<tr>
<td>StatusCodeFilter</td>
<td>  {202, 204, 206}</td>
</tr>
<tr>
<td>UserAgentFilter</td>
<td>  {Mozilla/4.0 (compatible; MSIE 4.01; Windows NT; MS Search 5.0 Robot), Mozilla/4.0   (compatible; MSIE 4.01; Windows NT; MS Search 6.0 Robot)}</td>
</tr>
<tr>
<td>UserFilter</td>
<td>  {SHAREPOINT\system}</td>
</tr>
<tr>
<td>Columns</td>
<td>  {WebApplicationId UniqueIdentifier, ServerUrl NVarChar(256), SiteId UniqueIdentifier, SiteUrl NVarChar(256)...}</td>
</tr>
<tr>
<td>UsageEntryType</td>
<td>  Microsoft.SharePoint.Administration.SPRequestUsageEntry</td>
</tr>
<tr>
<td>Description</td>
<td>  Page Requests</td>
</tr>
<tr>
<td>DaysToKeepDetailedData</td>
<td>  7</td>
</tr>
<tr>
<td>RetentionPeriod</td>
<td>  7</td>
</tr>
<tr>
<td>ProvisionSchema</td>
<td>  True</td>
</tr>
<tr>
<td>Enabled</td>
<td>  True</td>
</tr>
<tr>
<td>DaysToKeepData</td>
<td>  365</td>
</tr>
<tr>
<td><strong><span style="color: #ff0000">DaysToKeepUsageFiles</span></strong></td>
<td><strong><span style="color: #ff0000">  5</span></strong></td>
</tr>
<tr>
<td>MaxTotalSizeInBytes</td>
<td>  10000000000000</td>
</tr>
<tr>
<td>EnableReceivers</td>
<td>  False</td>
</tr>
<tr>
<td>Receivers</td>
<td>  {}</td>
</tr>
<tr>
<td>Hidden</td>
<td>  False</td>
</tr>
<tr>
<td>UsageDatabaseEnabled</td>
<td>  True</td>
</tr>
<tr>
<td>Name</td>
<td>  Page Requests</td>
</tr>
<tr>
<td>TypeName</td>
<td>  Microsoft.SharePoint.Administration.SPRequestUsageDefinition</td>
</tr>
<tr>
<td>DisplayName</td>
<td></td>
</tr>
<tr>
<td>Id</td>
<td>  5971d5e1-8869-4a49-bbe9-67493c697ae2</td>
</tr>
<tr>
<td>Status</td>
<td>  Online</td>
</tr>
<tr>
<td>Parent</td>
<td>  SPFarm Name=SharePoint_Config</td>
</tr>
<tr>
<td>Version</td>
<td>  2983</td>
</tr>
<tr>
<td>DeploymentLocked</td>
<td>  False</td>
</tr>
<tr>
<td>Properties</td>
<td>  {}</td>
</tr>
<tr>
<td>Farm</td>
<td>  SPFarm Name=SharePoint_Config</td>
</tr>
<tr>
<td>UpgradedPersistedProperties</td>
<td>  {}</td>
</tr>
<tr>
<td>Retention</td>
<td>  7</td>
</tr>
</tbody>
</table>
&nbsp;

<strong>How to modify the value to 0 (Zero) so that the files will be cleared every day?</strong>
<pre><em><strong> $pr= Get-SPUsageDefinition | where {$_.Name -like "Page Requests"}</strong></em>
 <em><strong>$pr.DaysToKeepUsageFiles=0</strong></em>
 <em><strong>$pr.EnableReceivers=$true</strong></em>
 <em><strong>$pr.Update()</strong></em></pre>
Wait for the Timer job "Microsoft SharePoint Foundation Usage Data Processing" to process the data files

&nbsp;

<strong>POST BY : Anoop Prasad [MSFT]</strong>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013 : Certain sites have lost unique perms and Sharepoint won't allow inheritance to be broken</title>
      <link>https://docs.microsoft.com/archive/blogs/spses/sharepoint-2013-certain-sites-have-lost-unique-perms-and-sharepoint-wont-allow-inheritance-to-be-broken</link>
      <pubDate>Wed, 23 Aug 2017 02:33:10 GMT</pubDate>
      <dc:creator><![CDATA[Spses]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spses/?p=1745</guid>
      <description><![CDATA[We have recently come across the following symptom with Sharepoint 2013.

In a SharePoint 2013...]]></description>
      <content:encoded><![CDATA[We have recently come across the following symptom with Sharepoint 2013.

In a SharePoint 2013 farm, some of the sub sites within multiple site collections have lost their unique permissions. When attempting to break inheritance the UI shows that it succeeds, but going back to the user.aspx page, inheritance is not broken.
At the same time, if we go to any list and try to delete unique permissions, we cannot browse to the site and looks like all the content is deleted including the home\start.aspx , finally throwing an http 500 error.

Possible Cause:
------------------
Somehow the FirstUniqueAncestorWebId property was incorrectly set for the affected webs.

Resolution:
-------------
As per https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.spweb.firstuniqueancestorsecurableobject.aspx
SPWeb.FirstUniqueAncestorSecurableObject property
An ISecurableObject interface that represents the first unique ancestor website. This is the object where the ACL is defined. For a web with unique permission the First Unique Ancestor is itself. For a web that inherits permissions the First Unique Ancestor is one of the ancestral webs.

We can run a SQL Query like below to find this out. Please replace the content DB name and web URL accordingly

<em><strong>Use &lt;Content_DB_Name&gt;</strong></em>
<em><strong> select id,siteid,FirstUniqueAncestorWebId,ScopeId from dbo.AllWebs(nolock) where FullUrl = '&lt;Web URL&gt;'</strong></em>
Somehow the FirstUniqueAncestorWebId property was incorrectly set for the affected webs so we have to set FirstUniqueAncestorWebId correctly for these affected webs.

FirstUniqueAncestorWeb cannot be overridden as it is a get (read only) property.
HasUniquePerm cannot be overridden as it is based off of FirstUniqueAncestorWeb which again is read only.

The only option left is to use an Update query on the content database. As we know that direct DB edits are not supported, we encourage to have a support case created with Microsoft Support teams before proceeding.

<strong><em>Use &lt;Content_DB_Name&gt;</em></strong>
<strong><em>UPDATE AllWebs </em></strong>
<strong><em>SET FirstUniqueAncestorWebId = '&lt;Web ID from the above Select Query&gt;' , ScopeId= '&lt;Scope ID from the above Select Query&gt;' </em></strong>
<strong><em>WHERE Id = '&lt;Web ID from the above Select Query&gt;' and SiteId = '&lt;Site ID from the above Select Query&gt;'</em></strong>

<span style="color: #ff0000">[Caution] For understanding the supportability of SQL update command , please refer</span> <a href="https://support.microsoft.com/en-us/help/841057/support-for-changes-to-the-databases-that-are-used-by-office-server-pr"><em><strong>https://support.microsoft.com/en-us/help/841057/support-for-changes-to-the-databases-that-are-used-by-office-server-pr</strong></em></a>

Once this is done, browse to : &lt;web URL&gt;/_layouts/15/user.aspx

Click on the "Delete unique permissions" to clean up the permissions scopes abandoned in the DB, then clicking "Stop Inheriting" and setting the correct groups back for Vistor, Member and Owner this corrected the issue of unique perms.

&nbsp;

<strong>POST BY : Anoop Prasad [MSFT]</strong>]]></content:encoded>
    </item>
  </channel>
</rss>