<?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>Ahmed Amin</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ahmedamin/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ahmedamin/feed.xml</link>
    <description>Fix your SharePoint issues as I did!</description>
    <lastBuildDate>Wed, 31 Jan 2018 08:59:22 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>SharePoint Performance Issue</title>
      <link>https://docs.microsoft.com/archive/blogs/ahmedamin/sharepoint-performance-issue</link>
      <pubDate>Fri, 17 Nov 2017 19:04:29 GMT</pubDate>
      <dc:creator><![CDATA[Ahmed.Amin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ahmedamin/?p=555</guid>
      <description><![CDATA[Daily we are receiving dozens of cases about SharePoint performance being slow. Honestly, some of...]]></description>
      <content:encoded><![CDATA[Daily we are receiving dozens of cases about SharePoint performance being slow. Honestly, some of these cases can hardly be resolved, e.g. our SharePoint page loads in 6 seconds, and we want it to load in 3 seconds, or it used to load in 3 seconds, but not anymore :). Firstly, I would like to highlight that the performance issue is always relative. Maybe someone feels that 6 seconds are not acceptable for a page to be loaded; whilst i see this is totally fine with the amount of customizations that they have. In fact, your SharePoint sites load time, or SharePoint servers resources utilization(RAM/CPU/Network) totally depends on many factors, some of them are the below:
<ul>
 	<li>The customizations that you have in your SharePoint sites/farm.</li>
 	<li>The amount of concurrent users that are accessing your SharePoint sites.</li>
 	<li>The amount of data that you have on your SharePoint sites, and how this data is structured.</li>
 	<li>The number of your SharePoint servers (WFE/Application), and SQL servers.</li>
 	<li>The resources that you have for your servers(RAM/CPU/Disk/Network).</li>
</ul>
Based on the above, there are millions of reasons behind SharePoint performance issues. However, some of these reasons are very common and this is what i am going to highlight here in this blog, although it's frankly hard :), but let's see how the blog will end.

&nbsp;
<h3><span style="text-decoration: underline"><em><strong>Common Root Causes</strong></em></span>:</h3>
<ul>
 	<li>
<h4>SharePoint 2010 Usage Files</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>:
<ul>
 	<li>We have a known issue for SharePoint 2010 that the usage files are not deleted which is making the timer job “Microsoft SharePoint Foundation Usage Data Import” never completes. This issue is shipped with the below symptoms:</li>
 	<li>Missing or incomplete Web Analytics data</li>
 	<li>The “Timer Service Recycle” timer job is never able to actually restart the timer service. It tries to pause the Usage Data Import job and cannot, so after ten minutes it skips the recycle.</li>
 	<li>Memory bloat (leak) within owstimer.exe. You may see the timer service consume much more memory than normal. Restarting the timer service will bring it back to normal, but it will build up again over time.</li>
 	<li>The "Diagnostic Data Provider: Trace Log" timer job intermittently does not import the ULS log data into the Logging database.</li>
</ul>
</li>
 	<li><span style="text-decoration: underline"><em><strong>Solution</strong></em></span>:</li>
</ul>
</li>
</ul>
<p style="padding-left: 90px">The fix is in the <span style="text-decoration: underline"><em><strong>December 2013 Cumulative Update</strong> </em></span>for SharePoint 2010.</p>
<p style="padding-left: 90px">Reference: <a href="https://support.microsoft.com/en-gb/help/2916922/sharepoint-2010-usage-files-are-not-deleted--causing-timer-service-pro">https://support.microsoft.com/en-gb/help/2916922/sharepoint-2010-usage-files-are-not-deleted--causing-timer-service-pro</a></p>
&nbsp;
<ul>
 	<li>
<h4>Anti-Virus</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>:
<ul>
 	<li>Whatsoever the antivirus that you are using on your SharePoint servers, it has to exclude some directories for SharePoint's sake. Ignoring this fact will cause a tremendous performance issue for your SharePoint site loading time, and in some cases unexpected behaviors! Talking here about the <span style="text-decoration: underline"><em>antivirus that is installed on the OS level</em></span>.</li>
</ul>
</li>
 	<li><span style="text-decoration: underline"><em><strong>Solution</strong></em></span>:
<ul>
 	<li>Based on the installed SharePoint version there is a list with the required paths. For the complete list, please check <a href="https://support.microsoft.com/en-us/help/952167/certain-folders-may-have-to-be-excluded-from-antivirus-scanning-when-y">this article</a>.</li>
 	<li>To be Noted:
<ul>
 	<li>Take into consideration that if you have SharePoint server, you will need to add the directories for both SharePoint Server, and SharePoint Foundation. For instance, for SharePoint Server 2013, add the paths for SharePoint Foundation 2013 and SharePoint Server 2013.</li>
 	<li>The directories should be excluded along with their sub-directories.</li>
 	<li>For the path "C:\Users\<span style="color: #ff0000"><em><strong><span class="sbody-italic">ServiceAccount</span></strong></em></span>\AppData\Local\Temp\", this is not a path, rather you have to change the highlighted word <span style="color: #000000"><em><strong><span class="sbody-italic">ServiceAccount </span></strong></em><span class="sbody-italic">with your SharePoint service accounts, and application pool accounts. For instance, the below are excluded on my SharePoint lab.</span></span>
<ul>
 	<li>C:\Users\<span style="color: #000000"><em><strong><span class="sbody-italic">spfarm</span></strong></em></span>\AppData\Local\Temp\</li>
 	<li>C:\Users\<em><strong>Default_AppPool</strong></em>\AppData\Local\Temp\</li>
 	<li>C:\Users\<em><strong>Default_sa_AppPool</strong></em>\AppData\Local\Temp\</li>
</ul>
</li>
 	<li><span style="color: #ff0000;text-decoration: underline"><em>Important!</em></span><em> </em>If your SharePoint servers are virtual machines, add the directories on both the hosting machines, and the SharePoint servers. Whereas, I saw in some cases the antivirus which is installed on the hosting machine is causing troubles to the SharePoint servers which they are hosting. (strange but true!).</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>SCOM APM</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>:
<ul>
 	<li>Many customers come with a severe performance issue on their SharePoint servers, and after investigating their issues, we notice that they have SCOM APM installed which is <span style="color: #ff0000;text-decoration: underline"><em><strong>not supported</strong></em></span>.</li>
 	<li>In fact, there are several articles talking about this issue with detailed analysis, and one of them is Bugras' which can be found <a href="https://blog.bugrapostaci.com/tag/apm/">here</a> along with other articles that can be found below:
<ul>
 	<li><a href="https://technet.microsoft.com/en-us/library/jj614617.aspx?tduid=(1dfb939b69d4a5ed09b44f51992a8b97)(256380)(2459594)(TnL5HPStwNw-v0X_tBOK3jzpbtaadMW8RA)()">https://technet.microsoft.com/en-us/library/jj614617.aspx?tduid=(1dfb939b69d4a5ed09b44f51992a8b97)(256380)(2459594)(TnL5HPStwNw-v0X_tBOK3jzpbtaadMW8RA)()</a></li>
 	<li><a href="https://support.microsoft.com/en-us/help/3216459/system-center-2016-operations-manager-apm-agent-causing-heap-corruptio">https://support.microsoft.com/en-us/help/3216459/system-center-2016-operations-manager-apm-agent-causing-heap-corruptio</a></li>
</ul>
</li>
</ul>
</li>
 	<li><span style="text-decoration: underline"><em><strong>Solution</strong></em></span>:
<ul>
 	<li>Uninstall the Operations Manager monitoring agent</li>
 	<li>Restart the computer to completely unload all .dll files.</li>
</ul>
</li>
</ul>
<ul>
 	<li style="list-style-type: none">
<ul>
 	<li>Reinstall the Operations Manager agent without APM. To do this, run the following command:
<pre><b>msiexec /i MonAgent.msi NOAPM=1</b></pre>
<b>Note</b> The <b>NOAPM=1</b> parameter causes the Operations Manager agent to be installed without the .NET Framework application performance monitoring.</li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Security Token Service Causing high CPU Utilization</h4>
More information can be found <a href="https://blogs.msdn.microsoft.com/ahmedamin/2017/08/29/high-cpu-utilization-by-security-token-service-on-sharepoint-server-2013/">here</a>.</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Network Issue</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>:
<ul>
 	<li>Many performance issues are caused by having a non consistent network latency. Based on your network status your performance issue may become severe (getting SharePoint errors with correlations because of timeout errors to SQL), or only taking longer time than normal to load any SharePoint page.</li>
</ul>
</li>
 	<li><span style="text-decoration: underline"><em><strong>Solution</strong></em></span>:
<ul>
 	<li>For your SharePoint farm to work properly you have to ensure having a consistent (no timeouts!) intra-farm latency (<span style="text-decoration: underline"><em><strong>&lt; 1 ms</strong></em></span>). Specifically, there should be a highly consistent intra-farm latency of &lt;1ms (one way from SharePoint servers to SQL servers), 99.9% of the time over a period of ten minutes.</li>
 	<li><em><strong><span style="text-decoration: underline">How to figure this out, or identify this issue</span></strong></em>? - This can easily be done by using PING as shown below:</li>
 	<li><a href="https://msdnshared.blob.core.windows.net/media/2017/10/SharePointSQLNetworkLatency.jpg"><img width="639" height="587" class="alignnone wp-image-557 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/SharePointSQLNetworkLatency.jpg" /></a></li>
 	<li>As shown from the above, the response is always &lt;1ms and we don't have any timeouts which is what SharePoint loves :).</li>
 	<li>Reference: <a href="https://technet.microsoft.com/en-gb/library/cc748824.aspx#Anchor_6">https://technet.microsoft.com/en-gb/library/cc748824.aspx#Anchor_6</a></li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Servers' Specifications</h4>
<ul>
 	<li>You always have to check firstly if your SharePoint servers have the minimum required resources (RAM/Network/CPU), or not. You can verify this using the below links:
<ul>
 	<li>SharePoint Server 2010 Hardware Requirements: <a href="https://technet.microsoft.com/en-us/library/cc262485(v=office.14).aspx">https://technet.microsoft.com/en-us/library/cc262485(v=office.14).aspx</a></li>
 	<li>SharePoint Server 2013 Hardware Requirements: <a href="https://technet.microsoft.com/library/a88d3f72-7ac3-4f08-b302-c4ca0a796268(v=office.16).aspx">https://technet.microsoft.com/library/a88d3f72-7ac3-4f08-b302-c4ca0a796268(v=office.16).aspx</a></li>
 	<li>SharePoint Server 2016 Hardware Requirements: <a href="https://technet.microsoft.com/en-us/library/cc262485(v=office.16).aspx">https://technet.microsoft.com/en-us/library/cc262485(v=office.16).aspx</a></li>
</ul>
</li>
 	<li>Certainly, you have Search Service Application, right? - If so, then please have a look on the Search hardware requirements:
<ul>
 	<li>SharePoint 2013 Search Hardware Requirements: <a href="https://technet.microsoft.com/en-us/library/dn342836.aspx">https://technet.microsoft.com/en-us/library/dn342836.aspx</a></li>
 	<li>SharePoint 2016 Search Hardware Requirements: <a href="https://technet.microsoft.com/en-us/library/dn342836(v=office.16).aspx">https://technet.microsoft.com/en-us/library/dn342836(v=office.16).aspx</a></li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>SharePoint Version Supportability</h4>
In fact, this solution is not resolving the performance issue for most of the cases, but it's worth mentioning. Normally, our updates are shipped not only with new features, and fixes, but also with performance enhancements. Hence, it's always recommended to check and ensure that your SharePoint farm version has the least supported version. To get more information about this topic, and to know whether your farm is supported or not, please check this <a href="https://blogs.msdn.microsoft.com/ahmedamin/2017/09/14/is-my-sharepoint-version-fully-supported-by-Microsoft/">article</a>. If installing the updates won't fix your performance issue, maybe restarting the servers or running the SharePoint Products Configuration wizard, as a part of the SharePoint patches installation, will :).</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>SharePoint SQL Databases Outdated Statistics</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>:
<ul>
 	<li>When database statistics become outdated, SharePoint Server installations may experience one or more of the following symptoms:
<ul class="sbody-free_list">
 	<li>Slow load times and decreased performance that may generate an HTTP 500 error when you open a site page.</li>
 	<li>Slower performance that generates error messages such as the following:
<pre class="sbody-error">Service unavailable
Unknown SQL Exception 53</pre>
<pre class="sbody-error">Server Error in '/' Application Runtime Error</pre>
</li>
 	<li>Performing search crawls causes unexpected SQL Server performance, database locking, and blocking.</li>
 	<li>Long-running timer jobs such as the "Microsoft SharePoint Foundation Usage Data Processing" jobs that take progressively longer to finish during each iteration.</li>
 	<li>The inability to open a SharePoint site, and an error message that resembles the following:
<pre class="sbody-error">Unexpected System.Web.HttpException: Request timed out</pre>
</li>
 	<li>Site rendering time-outs when you load navigation, and the following error message:
<pre class="sbody-error">PortalSiteMapProvider was unable to fetch children for node</pre>
</li>
 	<li>High CPU usage on the server that's running SQL Server when it processes SharePoint queries.</li>
</ul>
</li>
</ul>
</li>
 	<li><em><span style="text-decoration: underline"><strong>Solution</strong></span></em>:
<ul>
 	<li>Although SharePoint 2010 and going forward has timer job for updating Index statistics; however, in some circumstances, we noticed that the timer job is not always successfully updating the statistics. For more information about this, check this article <a href="https://blogs.msdn.microsoft.com/erica/2012/10/31/sharepoint-and-database-statistics-why-are-they-out-of-date-and-what-to-do-about-it/">https://blogs.msdn.microsoft.com/erica/2012/10/31/sharepoint-and-database-statistics-why-are-they-out-of-date-and-what-to-do-about-it/</a></li>
 	<li>Therefore, we recommend updating the SharePoint content database statistics daily using the <code>FULLSCAN</code> option from SQL Server. Although SharePoint does have a timer job to update statistics by calling <code>proc_updatestatistics</code>, we strongly recommend implementing a scheduled maintenance plan from SQL Server to ensure database statistics are reliably updated on a daily basis.</li>
 	<li>When implementing the SQL Server maintenance plan to update the statistics on your SharePoint databases, it is not required to disable the job from SharePoint. However, because these maintenance tasks perform similar functions from both locations, it is permissible to disable the timer job from the SharePoint farm.</li>
 	<li>The timer job which updates the databases statistics relies beneath the health analyzer rule <a href="https://technet.microsoft.com/en-us/library/hh564122.aspx">Databases used by SharePoint have outdated index statistics</a>.</li>
</ul>
</li>
 	<li>Reference: <a href="https://support.microsoft.com/en-us/help/3103194/outdated-database-statistics-decrease-sharepoint-server-performance--c">https://support.microsoft.com/en-us/help/3103194/outdated-database-statistics-decrease-sharepoint-server-performance--c</a></li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Certificate Revocation List (CRL)</h4>
All the needed information can be found here <a href="https://support.microsoft.com/en-us/help/2625048/site-slowness-because-of-sharepoint-sts-certificate-crl-checking">https://support.microsoft.com/en-us/help/2625048/site-slowness-because-of-sharepoint-sts-certificate-crl-checking</a></li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Blob Cache</h4>
<ul>
 	<li>In some cases, we noticed that the root cause of the performance issue is the blob cache being enabled! <em><strong>shouldn't enabling blob cache resolve performance issues</strong><strong>?!</strong></em></li>
 	<li>In fact, if you don't follow the blob cache best practices, then you may experience a performance issue.
<ul>
 	<li>Make sure that you put the BLOB cache on a drive that has sufficient disk space available in which to store the cache.</li>
 	<li>select a drive that will be used by as few processes as possible so that the BLOB cache process does not encounter conflicts when it tries to access the drive. If too many processes compete for disk access on the drive where the BLOB cache is located, BLOB cache performance and other processes will be adversely affected. For instance, don't keep the blob cache in the same drive as the SharePoint trace logs.</li>
 	<li>If you plan to use the BLOB cache in a scenario with heavy cache use, such as serving videos in a high traffic environment, and if you will use ULS logging, consider placing the BLOB cache on a separate physical drive from the ULS log — not on a separate partition. Storing the BLOB cache and the ULS log on the same drive can result in poor server performance. If you place the BLOB cache and the ULS log on the same physical drive, make sure that you closely monitor the disk queue length for any performance effect.</li>
 	<li>If you have anti-virus already installed on your SharePoint servers, ensure excluding the blob cache directory and all its subdirectories from the AV scanning.</li>
 	<li>When you decide how large to make the BLOB cache, you must consider the number and size of the files to determine the total size of the data to be stored in the cache. By default, the BLOB cache is set to 10 gigabytes (GB). Allow at least 20 percent more space on the drive than the size of the cache. For example, if you have 100 GB of content, set the size of the cache to 120 GB on a drive that has at least 150 GB of space. If the BLOB cache is too small, serving files to users slows, reducing the performance of your site.</li>
 	<li>If you plan to use the image renditions feature on your site, you should account for each rendition being a separate BLOB in the cache. For example, if you plan to have five renditions per image, then you must allocate significantly more than the general estimate of 20 percent more space on the drive.</li>
</ul>
</li>
 	<li>Reference: <a href="https://technet.microsoft.com/en-us/library/ee424404.aspx#Section1c">https://technet.microsoft.com/en-us/library/ee424404.aspx#Section1c</a></li>
</ul>
</li>
</ul>
<h3></h3>
<h3><span style="text-decoration: underline"><em><strong>Not recommended SharePoint Data Structure/Configurations</strong></em></span>:</h3>
&nbsp;
<ul>
 	<li>
<h4>Verbose/VerboseEx Logging</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>:
<ul>
 	<li>Normally, you should not keep SharePoint Verbose logging, or VerboseEx logging enabled for long time, rather only to investigate a certain issue and to set it back to default right after. Whereas, Verbose/VerboseEx logging can quickly use drive space and affect drive and server performance.</li>
 	<li>You can verify the SharePoint log level from SharePoint Central Administration and via Monitoring &gt;&gt; Configure Diagnostic Logging. If the log categories are not in bold, then the log level is set to default, as shown below:</li>
 	<li><a href="https://msdnshared.blob.core.windows.net/media/2017/10/ULSLogLevel.jpg"><img width="724" height="549" class="alignnone size-large wp-image-645" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/ULSLogLevel-1024x849.jpg" /></a></li>
</ul>
</li>
 	<li><span style="text-decoration: underline"><em><strong>Solution</strong></em></span>
<ul>
 	<li>Just set the SharePoint log level back to default. Simply, you can do this either via Central Administration or by running the below command via SharePoint management shell.</li>
 	<li>
<pre>Clear-SPLogLevel</pre>
</li>
 	<li>It's worth mentioning that if you have a custom logging category from your dev team, ensure that the default log level is not Verbose :)</li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Debug=true and Web Application Batch Compilation</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>:
<ul>
 	<li>ASP.NET supports compiling applications in a special debug mode that facilitates developer troubleshooting. Debug mode causes ASP.NET to compile applications with extra information that enables a debugger to closely monitor and control the execution of an application.</li>
 	<li>Applications that are compiled in debug mode execute as expected. However, the performance of the application is affected. To avoid the effect on performance, it is a good idea to enable debugging only when a developer is doing interactive troubleshooting. By default, debugging is disabled.</li>
 	<li>How to verify if the web application debugging is enabled or not?
<ul>
 	<li>Open IIS Manager, and allocate your SharePoint site.</li>
 	<li>Access the site web.config file.</li>
 	<li>Check the value of the attributes <span style="color: #339966;text-decoration: underline"><em><strong>debug</strong></em> </span>and<em><strong> </strong><span style="color: #339966;text-decoration: underline"><strong>batch</strong></span><strong> </strong></em>which should have  <span style="color: #339966"><em><strong>false</strong> </em></span>value in order to avoid any performance issue. In other words, the web.config should contain the below tag.</li>
 	<li>
<pre>&lt;compilation batch="false" debug="false"&gt;</pre>
</li>
</ul>
</li>
</ul>
</li>
 	<li><span style="text-decoration: underline"><em><strong>Solution</strong></em></span>:
<ul>
 	<li>Disable the SharePoint web application debugging by having the below tag in the web application web.config</li>
 	<li>
<pre>&lt;compilation batch="false" debug="false"&gt;</pre>
</li>
 	<li>More information can be found here <a href="https://blogs.technet.microsoft.com/stefan_gossner/2012/07/20/sharepoint-memory-leak-caused-by-incorrect-web-config-settings/">https://blogs.technet.microsoft.com/stefan_gossner/2012/07/20/sharepoint-memory-leak-caused-by-incorrect-web-config-settings/</a></li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Audit Logs</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>
<ul>
 	<li>I saw cases where customers enabled SharePoint Audit Logging without configuring automatic trimming which will make the Audit Logs increase dramatically without being monitored and will certainly eventually cause a site performance issue.</li>
 	<li>We recommend that you only select <em><strong>Opening</strong> </em>or <em><strong>downloading documents</strong></em>, <em><strong>viewing items in lists</strong></em>, or <em><strong>viewing item properties</strong> </em>for SharePoint sites when absolutely needed. This <span style="color: #000000">option is likely to </span><span style="color: #ff0000"><em></em></span><span style="color: #ff0000;text-decoration: underline"><em>generate a large number of events that will potentially degrading the performance and other aspects of the site collection</em></span>.</li>
 	<li><em><strong>How to determine the current number of Audit Log records that you have</strong></em>? - This can be achieved by any of the below methods
<ul>
 	<li>Running the below commands via SharePoint Management Shell
<ul>
 	<li>
<pre>$site = Get-SPSite <mark><strong>SiteURL</strong></mark>
</pre>
</li>
 	<li>
<pre>$site.Audit.GetEntries().count</pre>
</li>
</ul>
</li>
 	<li>Via SQL server and using SQL Server Management Studio, for your content database check the properties of the table "<span style="text-decoration: underline"><em><strong>dbo.AuditData</strong></em></span>", as shown below:</li>
 	<li><a href="https://msdnshared.blob.core.windows.net/media/2017/10/SQL_AuditData.jpg"><img width="724" height="616" class="alignnone size-large wp-image-675" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/SQL_AuditData-1024x916.jpg" /></a></li>
</ul>
</li>
 	<li>If your site audit log records exceeds <span style="color: #ff0000;text-decoration: underline"><em><strong>5 Million records</strong></em></span>, then your users may experience performance issue when accessing this site.</li>
 	<li>Reference: <a href="https://support.office.com/en-us/article/Configure-audit-settings-for-a-site-collection-f5a346d0-ee0f-4412-a5e6-d9b5abaa1012">https://support.office.com/en-us/article/Configure-audit-settings-for-a-site-collection-f5a346d0-ee0f-4412-a5e6-d9b5abaa1012</a></li>
</ul>
</li>
 	<li><span style="text-decoration: underline"><em><strong>Solution</strong></em></span>:
<ul>
 	<li>If you are in this situation, you will need to enable Audit Log Trimming from the site collection settings page, and specify number of days to retain these logs. Hereafter, you will need to run the timer job "Audit Log Trimming" for your web application.</li>
 	<li>As the timer job "Audit Log Trimming" is by default scheduled to run monthly, I would recommend also scheduling it to run Daily or Weekly. Whereas, this can be achived as follows:
<ul>
 	<li>Access SharePoint Central Administration Site &gt;&gt; Monitoring &gt;&gt; Review Job Definitions.</li>
 	<li>Click on the timer job "Audit Log Trimming" for your web application.</li>
 	<li><a href="https://msdnshared.blob.core.windows.net/media/2017/10/AuditLogTrimming.jpg"><img width="1024" height="243" class="alignnone size-large wp-image-655" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/AuditLogTrimming-1024x243.jpg" /></a></li>
 	<li>Change its schedule as per your desire, or click <em><strong>Run Now </strong></em>button.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Large Lists/Libraries</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>
<ul>
 	<li>Do you have large lists/libraries in your farm? By large lists/libraries, we mean a list/library that has about 5,000 items or more. Yes, in our SharePoint boundaries and limits article we state that a single SharePoint list/library can hold up to 30 Million items/documents; however, this is a <span style="color: #ff0000"><em><strong><span style="text-decoration: underline">conditional supported number!</span></strong></em><span style="text-decoration: underline"></span> </span></li>
 	<li>If you are really going to have a list/library that has more than 5,000 items/documents, then you have to structure your list/library in order not to query the SQL server with more than 5,000 items/documents, unless you keep the default list/library throttling values.</li>
 	<li>So, why only 5,000 although the list/library can support up to 30 Million?
<ul>
 	<li>To minimize database contention SQL Server, the back-end database for SharePoint, often uses row-level locking as a strategy to ensure accurate updates without adversely impacting other users who are accessing other rows. However, if a read or write database operation, such as a query, causes more than 5,000 rows to be locked at once, then it's more efficient for SQL Server to temporarily lock the entire table until the database operation is completed.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p style="padding-left: 150px"><span style="color: #ff0000">Note: The actual number is not always 5,000, and can vary depending on your site, the amount of activity in the database, and your site's configuration.</span></p>

<ul>
 	<li style="list-style-type: none">
<ul>
 	<li style="list-style-type: none">
<ul>
 	<li style="list-style-type: none">
<ul>
 	<li><span style="color: #ff0000"></span>When the whole table is locked, it prevents other users from accessing the table. If this happens too often, then users will experience a degradation of system performance. Therefore, throttling and limits are essential to help minimize the impact of resource-intensive database operations and balance the needs of all users.</li>
 	<li>Event worse, this won't only impact this site collection, but all the site collections contained in the same content databases, as all the site collections inside a content database share the same items/documents tables.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p style="padding-left: 150px">Reference: https://support.office.com/en-us/article/Manage-large-lists-and-libraries-in-SharePoint-b8588dae-9387-48c2-9248-c24122f07c59</p>

<ul>
 	<li style="list-style-type: none">
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Solution</strong></em></span>
<ul>
 	<li>The solution here, in order to avoid encountering a performance issue due to large lists/libraries, is to ensure creating the items/documents inside folders; whereas, each folder should contain at most 5,000 items/documents. By doing so, we will be sure that SharePoint will never sent a SQL query with 5,000+ items/documents results.</li>
 	<li>Furthermore, ensure not using or creating any view that will retrieve more than 5,000 items/documents.</li>
 	<li>How to detect the large lists/libraries in your site?
<ul>
 	<li>This can be achieved via Site Settings &gt;&gt; Site Contents</li>
 	<li><a href="https://msdnshared.blob.core.windows.net/media/2017/10/SiteContents-1.jpg"><img width="229" height="154" class="alignnone size-full wp-image-685" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/SiteContents-1.jpg" /></a></li>
 	<li>Under each list/library, you will see the number of items, as highlighted below:</li>
 	<li><a href="https://msdnshared.blob.core.windows.net/media/2017/10/SiteContents-2.jpg"><img width="824" height="193" class="alignnone size-large wp-image-695" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/SiteContents-2-1024x393.jpg" /></a></li>
 	<li>If for any reason you would like to get all the lists/libraries in yours farm which exceed 5,000 items, there are plenty of scripts online performing so...</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>List/Library Throttling</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>
<ul>
 	<li style="list-style-type: none">
<ul>
 	<li>Whether you disabled the list view throttling intentionally or unintentionally (your dev team did), you have to know that SharePoint throttling is enabled by default for a valid reason and to save your back when a user is heavily using a list/library which eventually will impact all the users that are using this site collection and all the site collections included in the same content database.</li>
 	<li>As demonstrated in the Large Lists/Libraries section, if a read or write database operation, such as a query, causes more than 5,000 rows to be locked at once, then it's more efficient for SQL Server to temporarily lock the entire table until the database operation is completed, and that's why we have the view throttling configuring with 5,000 items.</li>
 	<li>Is my web application configured with list view throttling equals 5,000? - This can be known via Central Administration site &gt;&gt; Application Management &gt;&gt; Manage Web Applications, then select your web application and from the Ribbon choose General Settings &gt;&gt; Resource Throttling.</li>
 	<li><a href="https://msdnshared.blob.core.windows.net/media/2017/10/ListViewThreshold.jpg"><img width="501" height="624" class="alignnone size-large wp-image-705" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/ListViewThreshold-901x1024.jpg" /></a></li>
 	<li>In fact, the web application throttling is not the only place to configure throttling; whereas, lists/libraries can be configured using PowerShell. So, how to determine the lists/libraries that have throttling disabled?!</li>
 	<li>Using the below code should do the trick for you.</li>
</ul>
</li>
</ul>
<blockquote style="margin-right: 0px">
<blockquote style="margin-right: 0px">
<pre><span style="color: #0000ff;font-family: Lucida Console">Add-PSSnapin</span><span style="font-family: Lucida Console"> </span><span style="color: #8a2be2;font-family: Lucida Console">Microsoft.SharePoint.PowerShell</span><span style="font-family: Lucida Console"> </span><span style="color: #000080;font-family: Lucida Console">-ErrorAction</span><span style="font-family: Lucida Console"> </span><span style="color: #8a2be2;font-family: Lucida Console">SilentlyContinue
</span>
<span style="color: #ff4500;font-family: Lucida Console">$webApplicationURL</span><span style="font-family: Lucida Console"> </span><span style="color: #a9a9a9;font-family: Lucida Console">=</span><span style="font-family: Lucida Console"> </span><span style="color: #0000ff;font-family: Lucida Console">Read-Host</span><span style="font-family: Lucida Console"> </span><span style="color: #8b0000;font-family: Lucida Console">"Enter Web Application URL"</span>
<span style="color: #ff4500;font-family: Lucida Console">$reportPath</span><span style="font-family: Lucida Console"> </span><span style="color: #a9a9a9;font-family: Lucida Console">=</span><span style="font-family: Lucida Console"> </span><span style="color: #0000ff;font-family: Lucida Console">Read-Host</span><span style="font-family: Lucida Console"> </span><span style="color: #8b0000;font-family: Lucida Console">"Enter full Path URL in the format (d:\temp\throttledLists.txt)"</span>
<span style="color: #ff4500;font-family: Lucida Console">$webapplication</span><span style="font-family: Lucida Console"> </span><span style="color: #a9a9a9;font-family: Lucida Console">=</span><span style="font-family: Lucida Console"> </span><span style="color: #0000ff;font-family: Lucida Console">Get-SPWebApplication</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$webApplicationURL</span>
<span style="color: #ff4500;font-family: Lucida Console">$sites</span><span style="font-family: Lucida Console"> </span><span style="color: #a9a9a9;font-family: Lucida Console">=</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$webapplication</span><span style="color: #a9a9a9;font-family: Lucida Console">.</span><span style="font-family: Lucida Console">Sites</span>
<span style="color: #0000ff;font-family: Lucida Console">Write-Output</span><span style="font-family: Lucida Console"> </span><span style="color: #8b0000;font-family: Lucida Console">"List URL"</span><span style="font-family: Lucida Console"> </span><span style="color: #a9a9a9;font-family: Lucida Console">|</span><span style="font-family: Lucida Console"> </span><span style="color: #0000ff;font-family: Lucida Console">Out-File</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$reportPath</span>

<span style="color: #00008b;font-family: Lucida Console">foreach</span><span style="font-family: Lucida Console">(</span><span style="color: #ff4500;font-family: Lucida Console">$site</span><span style="font-family: Lucida Console"> </span><span style="color: #00008b;font-family: Lucida Console">in</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$sites</span><span style="font-family: Lucida Console">)</span>
{
<span style="font-family: Lucida Console">    </span><span style="color: #ff4500;font-family: Lucida Console">$webs</span><span style="font-family: Lucida Console"> </span><span style="color: #a9a9a9;font-family: Lucida Console">=</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$site</span><span style="color: #a9a9a9;font-family: Lucida Console">.</span><span style="font-family: Lucida Console">AllWebs</span>
<span style="font-family: Lucida Console"> </span><span style="font-family: Lucida Console">   </span><span style="color: #00008b;font-family: Lucida Console">foreach</span><span style="font-family: Lucida Console">(</span><span style="color: #ff4500;font-family: Lucida Console">$web</span><span style="font-family: Lucida Console"> </span><span style="color: #00008b;font-family: Lucida Console">in</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$webs</span><span style="font-family: Lucida Console">)</span>
    {
<span style="font-family: Lucida Console">       </span><span style="color: #ff4500;font-family: Lucida Console">$lists</span><span style="font-family: Lucida Console"> </span><span style="color: #a9a9a9;font-family: Lucida Console">=</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$web</span><span style="color: #a9a9a9;font-family: Lucida Console">.</span><span style="font-family: Lucida Console">Lists</span>
<span style="font-family: Lucida Console"> </span><span style="font-family: Lucida Console">      </span><span style="color: #00008b;font-family: Lucida Console">foreach</span><span style="font-family: Lucida Console">(</span><span style="color: #ff4500;font-family: Lucida Console">$list</span><span style="font-family: Lucida Console"> </span><span style="color: #00008b;font-family: Lucida Console">in</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$lists</span><span style="font-family: Lucida Console">)</span>
        {
<span style="font-family: Lucida Console">          </span><span style="color: #00008b;font-family: Lucida Console">if</span><span style="font-family: Lucida Console">(</span><span style="color: #a9a9a9;font-family: Lucida Console">-not</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$list</span><span style="color: #a9a9a9;font-family: Lucida Console">.</span><span style="font-family: Lucida Console">EnableThrottling)</span>
           {
<span style="font-family: Lucida Console">             </span><span style="color: #ff4500;font-family: Lucida Console">$listUrl</span><span style="font-family: Lucida Console"> </span><span style="color: #a9a9a9;font-family: Lucida Console">=</span><span style="font-family: Lucida Console"> </span><span style="color: #8b0000;font-family: Lucida Console">"</span><span style="font-family: Lucida Console">$(</span><span style="color: #ff4500;font-family: Lucida Console">$web</span><span style="color: #a9a9a9;font-family: Lucida Console">.</span><span style="font-family: Lucida Console">Url)$(</span><span style="color: #ff4500;font-family: Lucida Console">$list</span><span style="color: #a9a9a9;font-family: Lucida Console">.</span><span style="font-family: Lucida Console">DefaultViewUrl)</span><span style="color: #8b0000;font-family: Lucida Console">"</span>
<span style="color: #8b0000;font-family: Lucida Console"> </span><span style="font-family: Lucida Console"></span><span style="font-family: Lucida Console">            </span><span style="color: #0000ff;font-family: Lucida Console">Write-Host</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$listUrl</span><span style="font-family: Lucida Console"> </span><span style="color: #000080;font-family: Lucida Console">-ForegroundColor</span><span style="font-family: Lucida Console"> </span><span style="color: #8a2be2;font-family: Lucida Console">Red</span>
            <span style="color: #8a2be2;font-family: Lucida Console"> </span><span style="font-family: Lucida Console"></span><span style="font-family: Lucida Console"> </span><span style="color: #0000ff;font-family: Lucida Console">Write-Output</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$listUrl</span><span style="font-family: Lucida Console"> </span><span style="color: #a9a9a9;font-family: Lucida Console">|</span><span style="font-family: Lucida Console"> </span><span style="color: #0000ff;font-family: Lucida Console">Out-File</span><span style="font-family: Lucida Console"> </span><span style="color: #ff4500;font-family: Lucida Console">$reportPath</span><span style="font-family: Lucida Console"> </span><span style="color: #000080;font-family: Lucida Console">-append</span><span style="font-family: Lucida Console"> </span>
           }
        }
<span style="font-family: Lucida Console">       </span><span style="color: #ff4500;font-family: Lucida Console">$web</span><span style="color: #a9a9a9;font-family: Lucida Console">.</span><span style="font-family: Lucida Console">Dispose()</span>
    }
<span style="font-family: Lucida Console">    </span><span style="color: #ff4500;font-family: Lucida Console">$site</span><span style="color: #a9a9a9;font-family: Lucida Console">.</span><span style="font-family: Lucida Console">Dispose()</span>
}
<span style="color: #0000ff;font-family: Lucida Console"></span><span style="color: #0000ff;font-family: Lucida Console">Write-Host</span><span style="font-family: Lucida Console"> </span><span style="color: #8b0000;font-family: Lucida Console">"Script is completed successfully!"</span><span style="font-family: Lucida Console"> </span><span style="color: #000080;font-family: Lucida Console">-ForegroundColor</span><span style="font-family: Lucida Console"> </span><span style="color: #8a2be2;font-family: Lucida Console">Green </span></pre>
</blockquote>
</blockquote>
</li>
 	<li><span style="text-decoration: underline"><em><strong>Solutio</strong></em></span>
<ul>
 	<li>Just keep the web application throttling values as they are :).</li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Workflow Tasks/History Lists</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>:
<ul>
 	<li>SharePoint workflow tasks list, and history list can grow indefinitely which is going to cause a performance issue in your site. Here it comes our default enabled timer job "Workflow Auto Cleanup" which runs to delete the old workflow tasks, and workflow instances.</li>
 	<li>However, if you disable this timer job, or increase your workflow retention from 60 days, then you will have to keep an eye on your tasks list.</li>
 	<li>Workflow Tasks list, and History list are normal lists at the end; so, they should not contain much items there.</li>
</ul>
</li>
 	<li><span style="text-decoration: underline"><em><strong>Solution</strong></em></span>:
<ul>
 	<li>Do not disable the timer job "Workflow Auto Cleanup". If you have to disable it, keep an eye on your workflow Tasks list, and ensure that you have an archival system on it.</li>
 	<li>Reference: <a href="https://technet.microsoft.com/en-us/library/ee662522(v=office.14).aspx">https://technet.microsoft.com/en-us/library/ee662522(v=office.14).aspx</a></li>
 	<li>Ensure using a separate workflow Tasks list, and History list for each workflow association.</li>
 	<li>More information can be found here <a href="https://blogs.msdn.microsoft.com/ahmedamin/2017/10/01/sharepoint-workflow-auto-cleanup/">https://blogs.msdn.microsoft.com/ahmedamin/2017/10/01/sharepoint-workflow-auto-cleanup/</a></li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Unique Granted Permissions(ACL)</h4>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Issue</strong></em></span>:
<ul>
 	<li>We have two configurations/limits here, as follows:
<table summary="table">
<tbody>
<tr>
<td>Security scope</td>
<td>50,000 per list</td>
<td>Threshold</td>
<td>The maximum number of unique security scopes set for a list cannot exceed 50,000.

For most farms, we recommend that you consider lowering this limit to 5,000 unique scopes. For large lists, consider using a design that uses as few unique permissions as possible.

When the number of unique security scopes for a list exceeds the value of the list view threshold (set by default at 5,000 list items), additional SQL Server round trips take place when the list is viewed, which can adversely affect list view performance.

A scope is the security boundary for a securable object and any of its children that do not have a separate security boundary defined. A scope contains an Access Control List (ACL), but unlike NTFS ACLs, a scope can include security principals that are specific to SharePoint Server 2013. The members of an ACL for a scope can include Windows users, user accounts other than Windows users (such as forms-based accounts), Active Directory groups, or SharePoint groups.</td>
</tr>
</tbody>
</table>
<table summary="table">
<tbody>
<tr>
<td>Security principal: size of the Security Scope</td>
<td>5,000 per Access Control List (ACL)</td>
<td>Supported</td>
<td>The size of the scope affects the data that is used for a security check calculation. This calculation occurs every time that the scope changes. There is no hard limit, but the bigger the scope, the longer the calculation takes.</td>
</tr>
</tbody>
</table>
</li>
 	<li>Hence, in order to identify the security scopes which are big already, you can run the below SQL query. However, as we in MS don't recommend running SQL queries, and i personally hate doing so, i would recommend taking a backup from your content database, restore it on another SQL server, and then run the below SQL query.</li>
 	<li>
<pre><span style="color: #0000ff;font-family: Consolas;font-size: medium">select</span><span style="font-family: Consolas;font-size: medium"> </span><span style="color: #ff00ff;font-family: Consolas;font-size: medium">COUNT</span><span style="color: #808080;font-family: Consolas;font-size: medium">(</span><span style="font-family: Consolas;font-size: medium">ra</span><span style="color: #808080;font-family: Consolas;font-size: medium">.</span><span style="font-family: Consolas;font-size: medium">PrincipalId</span><span style="color: #808080;font-family: Consolas;font-size: medium">)</span><span style="font-family: Consolas;font-size: medium"> </span><span style="color: #0000ff;font-family: Consolas;font-size: medium">as</span><span style="font-family: Consolas;font-size: medium"> [Count]</span><span style="color: #808080;font-family: Consolas;font-size: medium">,</span><span style="font-family: Consolas;font-size: medium">p</span><span style="color: #808080;font-family: Consolas;font-size: medium">.</span><span style="font-family: Consolas;font-size: medium">ScopeUrl</span>
<span style="color: #0000ff;font-family: Consolas;font-size: medium">from</span><span style="font-family: Consolas;font-size: medium"> RoleAssignment ra </span><span style="color: #0000ff;font-family: Consolas;font-size: medium">with</span><span style="color: #808080;font-family: Consolas;font-size: medium">(</span><span style="color: #0000ff;font-family: Consolas;font-size: medium">nolock</span><span style="color: #808080;font-family: Consolas;font-size: medium">)</span>
<span style="color: #808080;font-family: Consolas;font-size: medium">join</span><span style="font-family: Consolas;font-size: medium"> Perms p </span><span style="color: #0000ff;font-family: Consolas;font-size: medium">with</span><span style="color: #808080;font-family: Consolas;font-size: medium">(</span><span style="color: #0000ff;font-family: Consolas;font-size: medium">nolock</span><span style="color: #808080;font-family: Consolas;font-size: medium">)</span><span style="font-family: Consolas;font-size: medium"> </span><span style="color: #0000ff;font-family: Consolas;font-size: medium">on</span><span style="font-family: Consolas;font-size: medium"> p</span><span style="color: #808080;font-family: Consolas;font-size: medium">.</span><span style="font-family: Consolas;font-size: medium">SiteId </span><span style="color: #808080;font-family: Consolas;font-size: medium">=</span><span style="font-family: Consolas;font-size: medium"> ra</span><span style="color: #808080;font-family: Consolas;font-size: medium">.</span><span style="font-family: Consolas;font-size: medium">SiteId </span><span style="color: #808080;font-family: Consolas;font-size: medium">and</span><span style="font-family: Consolas;font-size: medium"> p</span><span style="color: #808080;font-family: Consolas;font-size: medium">.</span><span style="font-family: Consolas;font-size: medium">ScopeId </span><span style="color: #808080;font-family: Consolas;font-size: medium">=</span><span style="font-family: Consolas;font-size: medium"> ra</span><span style="color: #808080;font-family: Consolas;font-size: medium">.</span><span style="font-family: Consolas;font-size: medium">ScopeId</span>
<span style="color: #0000ff;font-family: Consolas;font-size: medium">group</span><span style="font-family: Consolas;font-size: medium"> </span><span style="color: #0000ff;font-family: Consolas;font-size: medium">by</span><span style="font-family: Consolas;font-size: medium"> p</span><span style="color: #808080;font-family: Consolas;font-size: medium">.</span><span style="font-family: Consolas;font-size: medium">ScopeUrl</span>
<span style="color: #0000ff;font-family: Consolas;font-size: medium">order</span><span style="font-family: Consolas;font-size: medium"> </span><span style="color: #0000ff;font-family: Consolas;font-size: medium">by</span><span style="font-family: Consolas;font-size: medium"> [Count] </span><span style="color: #0000ff;font-family: Consolas;font-size: medium">desc</span></pre>
</li>
 	<li>Running the above query should display results, as shown below:</li>
 	<li><a href="https://msdnshared.blob.core.windows.net/media/2017/10/SharePointCL-2.jpg"><img width="309" height="191" class="alignnone size-full wp-image-725" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/SharePointCL-2.jpg" /></a></li>
</ul>
</li>
 	<li></li>
 	<li><span style="text-decoration: underline"><em><strong>Solution</strong></em></span>:
<ul>
 	<li>The solution here is easy, but hard to be implemented.
<ul>
 	<li>Ensure not having many scope URLs. In other words, don't make many items have unique scopes. For instance, don't make each single item in a list has a unique scope. As doing so will eventually increase the number of unique scopes, and will eventually cause a severe performance issue.</li>
 	<li>Try not granting permissions to individual users, rather to groups. Even better, use AD groups for granting permissions instead of SharePoint groups which may also contains so many users that will impact your site performance.</li>
 	<li>More information can be found here on <a href="https://blog.bugrapostaci.com/2011/08/01/how-to-fix-64bit-acl-limit-exceeded-problem-on-sharepoint/">Bugra's article</a>, although it's for SharePoint 2007, but the concept is similar.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>
<h4>Custom Code</h4>
Information about coding best practices can be found here <a href="https://msdn.microsoft.com/en-us/library/bb687949(v=office.12).aspx">https://msdn.microsoft.com/en-us/library/bb687949(v=office.12).aspx</a></li>
</ul>
&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Requested Registry Access Is Not Allowed</title>
      <link>https://docs.microsoft.com/archive/blogs/ahmedamin/requested-registry-access-is-not-allowed</link>
      <pubDate>Sun, 15 Oct 2017 15:08:53 GMT</pubDate>
      <dc:creator><![CDATA[Ahmed.Amin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ahmedamin/?p=665</guid>
      <description><![CDATA[Issue
The problem was reported that no one is able to use InfoPath forms on the SharePoint sites;...]]></description>
      <content:encoded><![CDATA[<h3><span style="text-decoration: underline"><em><strong>Issue</strong></em></span></h3>
The problem was reported that no one is able to use InfoPath forms on the SharePoint sites; whereas, all the users were getting the generic SharePoint error with correlation ID. Checking the ULS logs showed the below

&nbsp;
<pre>xx/xx/xxxx xx:xx:xx.xx w3wp.exe 0x3394 SharePoint Foundation Runtime 6616 Critical <span style="color: #ff0000">Requested registry access is not allowed</span>. 
xx/xx/xxxx xx:xx:xx.xx w3wp.exe 0x3394 SharePoint Foundation General aat87 Monitorable <span style="color: #ff0000">An unexpected error has occurred</span>.</pre>
&nbsp;

Checking ULS showed the below:
<pre>Log Name:      Application
Source:        Microsoft-SharePoint Products-SharePoint Foundation
Date:          xx/xx/xxxx xx:xx:xx
Event ID:      6616
Task Category: Runtime
Level:         Error
Keywords:      
User:          NT AUTHORITY\IUSR
Computer:      ahmed.amin.com
Description:
<span style="color: #ff0000">Requested registry access is not allowed</span>.</pre>
<h3><span style="text-decoration: underline"><em>Cause</em></span></h3>
<span style="color: #000000">As reported in both the SharePoint ULS logs and the Application event log, "Requested registry access is not allowed". </span>
<h3><span style="text-decoration: underline"><em>Solution</em></span></h3>
In fact, we can resolve this issue by either following the hard approach, by using <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/procmon">ProcMon,</a> finding the registry key which we don't have access on, or just run the <em><strong>SharePoint Products Configuration Wizard</strong></em> which is<span style="text-decoration: underline"></span> used to secure the SharePoint resources (registry keys, and other resource). In our case, the problem was kind of severe, as there were some updates installed on one server and not on all the servers in the farm. Moreover, the customer did not run the SharePoint Products Configuration Wizard right after. Hence, when accessing the page <strong><em>Manage Servers in this farm</em></strong><em></em> (via Central Administration site &gt;&gt; System Settings) we found that some of the farm servers are with the status "<em><strong><span style="color: #ff0000">Upgrade Required</span></strong></em>"!

&nbsp;

In order to fix this issue, we firstly identified the missing updates on the farm servers, which were installed on one SharePoint server and not on all the farm servers, by accessing the page <em><strong>Check Product and Patch Installation Status</strong></em> (via Central Administration &gt;&gt; Upgrade and Migration), or you can simply list the missing updates by running the SharePoint Products Configuration wizard. Hereafter, we performed the below:
<ol>
 	<li>Installed the missing SharePoint updates on all the farm servers.</li>
 	<li>Restarted all the SharePoint servers after the updates were installed.</li>
 	<li>Ran the SharePoint Products Configuration wizard starting with the Central Administration server, and sequentially on all the farm servers.</li>
</ol>
<p style="padding-left: 30px"><span style="color: #ff0000">N.B., ensure that you perform the above steps using a farm administrator who is a local administrator on all the SharePoint servers in the farm.</span></p>
&nbsp;

If for any reason the above does not resolve your issue, run the below command via SharePoint Management Shell using your farm admin.
<pre>psconfig.exe -cmd secureresources
</pre>
&nbsp;

<span style="color: #ff0000">P.S., please note that running the SharePoint Products Configuration Wizard will make all your SharePoint sites down. Hence, ensure planning this, and having a valid SQL backup from your SharePoint databases.</span>

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>clientAppDisplayName needs permission to access resources in your organization that only an admin can grant. Please ask an admin to grant permission to this app before you can use it</title>
      <link>https://docs.microsoft.com/archive/blogs/ahmedamin/clientappdisplayname-needs-permission-to-access-resources-in-your-organization-that-only-an-admin-can-grant-please-ask-an-admin-to-grant-permission-to-this-app-before-you-can-use-it</link>
      <pubDate>Sun, 08 Oct 2017 16:18:14 GMT</pubDate>
      <dc:creator><![CDATA[Ahmed.Amin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ahmedamin/?p=597</guid>
      <description><![CDATA[Issue
You created your own Single Page Applications (SPA) using ADAL.js to connect to SharePoint...]]></description>
      <content:encoded><![CDATA[<h3><span style="text-decoration: underline">Issue</span></h3>
You created your own Single Page Applications (SPA) using ADAL.js to connect to SharePoint REST endpoints in order to retrieve and change data. Maybe you followed <a href="https://github.com/nickvdheuvel/O365-ADALJS-examples/tree/master/Authenticate-an-Office-365-user-with-ADAL-JS">this article</a>! However, while accessing your application, it fails with the below error:
<pre>&lt;clientAppDisplayName&gt;
You can't access this application
&lt;clientAppDisplayName&gt; <span style="color: #ff0000">needs permission to access resources in your organization that only an admin can grant. Please ask an admin to grant permission to this app before you can use it</span>.</pre>
<h3><span style="text-decoration: underline">Cause</span></h3>
The problem happens because your SPA is accessing your SharePoint site data, or maybe modifying the site content, whilst, the application does not have consent! Well, the full story about consent framework can be found <a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications">here</a>. In a nutshell, the flow goes as follows:
<ul>
 	<li>Your SPA needs permissions to access the SharePoint data, or change it. Hence, you, as a developer/admin, have to grant it the needed permissions. Some of these permissions <strong><em>Requires Admin</em></strong> as shown below:</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2017/10/spaRequiresAdmin.jpg"><img width="597" height="501" class="alignnone size-full wp-image-605" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/spaRequiresAdmin.jpg" /></a>
<ul>
 	<li>You granted your application the needed permissions, the application is running, and a user is about to use it for the first time. If the application has not already acquired an access or refresh token, the application needs to go to Azure AD’s authorization endpoint to obtain an authorization code that can be used to acquire a new access and refresh token.</li>
 	<li>If the user is not already authenticated, they’ll be asked to sign in to Azure AD.</li>
 	<li>After the user has signed in, Azure AD will determine if the user needs to be shown a consent page. This determination is based on whether the user (or their organization’s administrator) has already granted the application consent. If consent has not already been granted, Azure AD will prompt the user for consent and will display the required permissions it needs to function. The set of permissions that is displayed in the consent dialog are the same as what was selected in the Delegated Permissions in the Azure portal.</li>
 	<li>After the user grants consent, an authorization code is returned to your application, which can be redeemed to acquire an access token and refresh token.</li>
 	<li>For delegated permission that requires admin, the consent have to be granted by the global tenant Administrator.</li>
</ul>
<span style="color: #000000;font-family: Calibri">In a nutshell, adding a delegated permission to an application does not automatically grant consent to the users within the tenant, as it did in the Azure Classic Portal. The users must still manually consent for the added delegated permissions at runtime, unless the administrator clicks the <b>Grant Permissions</b> button from the <b>Required Permissions</b> section of the application page in the Azure portal.</span>
<h3><span style="text-decoration: underline">Solution</span></h3>
<span style="font-family: Calibri"><span style="color: #000000"><b><i><u>For single page applications (SPA) using ADAL.js</u></i></b>, granting explicit consent using the <b>Grant Permissions</b> button is currently <span style="color: #ff0000;text-decoration: underline"><em><strong>required</strong></em></span>, as the access token is requested without a consent prompt, which will fail if consent is not already granted. Therefore, the below has to be done:</span></span>
<ul>
 	<li>Access the URL <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Faad.portal.azure.com%2F&amp;data=02%7C01%7Cahamin%40microsoft.com%7Cafe398b40102459001cc08d50b3f25a7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636427288233561048&amp;sdata=RJd69yaYuneHTMzaOVWv%2B9rganjv7Lt3xfs6Ce9CRIk%3D&amp;reserved=0">https://aad.portal.azure.com/</a></li>
 	<li>From the left navigation click on <strong><em>More Services</em></strong> &gt;&gt; <strong><em>App registrations</em></strong></li>
 	<li>Select your App, and then click on <strong><em>Required Permissions</em></strong>.</li>
 	<li>Click on <strong><em>Add</em></strong> button, and then <strong><em>Select an API</em></strong>.</li>
 	<li>Select <u>Office 365 SharePoint Online (Microsoft.SharePoint)</u>, and click on <em><strong>Select</strong></em> button.</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2017/10/SPA_SelectApp.jpg"><img width="1024" height="227" class="alignnone size-large wp-image-636" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/SPA_SelectApp-1024x227.jpg" /></a><a href="https://msdnshared.blob.core.windows.net/media/2017/10/SPASelectApp.jpg"></a></p>

<ul>
 	<li>Tick the suitable permission(s) for your application under the category "<em><strong>Delegated Permissions</strong></em>", and save your changes.</li>
</ul>
<p style="padding-left: 30px"><span style="color: #ff0000">N.B., if you select any permission that "Requires Admin", the below step has to be done by the tenant global admin. In addition, it has to be done by the administrator in all cases to be applied on all users.</span></p>

<ul>
 	<li>Click <strong>Grant Permissions </strong>button<strong>.</strong></li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2017/10/SPA_GrantPermissions.jpg"><img width="851" height="192" class="alignnone size-full wp-image-617" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/SPA_GrantPermissions.jpg" /></a></p>

<ul>
 	<li>Click Yes.</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2017/10/SPA_GrantPermissions2.jpg"><img width="851" height="192" class="alignnone size-large wp-image-625" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/SPA_GrantPermissions2-1024x235.jpg" /></a></p>
&nbsp;

Reference: <a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications">https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications</a>

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>New-OfficeWebAppsFarm : The Office Online service failed to start. See the Windows Application Event Log for more details</title>
      <link>https://docs.microsoft.com/archive/blogs/ahmedamin/new-officewebappsfarm-the-office-online-service-failed-to-start-see-the-windows-application-event-log-for-more-details</link>
      <pubDate>Thu, 05 Oct 2017 17:35:30 GMT</pubDate>
      <dc:creator><![CDATA[Ahmed.Amin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ahmedamin/?p=567</guid>
      <description><![CDATA[Issue
While building your Office Online Server farm by running the command "New-OfficeWebAppsFarm",...]]></description>
      <content:encoded><![CDATA[<h3><span style="text-decoration: underline">Issue</span></h3>
While building your <span style="text-decoration: underline"><em><strong>Office Online Server</strong></em></span><em> </em>farm by running the command "New-OfficeWebAppsFarm", you may get an error as the below:

&nbsp;
<pre><span style="color: #ff0000">New-OfficeWebAppsFarm : The Office Online service failed to start. See the Windows Application Event Log for more details</span>. At line:1 char:1 + New-OfficeWebAppsFarm -InternalURL "<a href="https://oos.bilfinger.net/">https://oos.ahmedamin.com</a>" -Exter ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [New-OfficeWebAppsFarm], ApplicationFailedException + FullyQualifiedErrorId : AgentManagerStartFailed,Microsoft.Office.Web.Apps.Administration.NewFarmCommand</pre>
&nbsp;

Checking the event log will show the below:
<pre>Log Name: Application
Source: WACSM
Date: 21.09.2017 10:39:55
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: server
Description:
<span style="color: #ff0000">Service cannot be started. System.TypeInitializationException: The type initializer for 'Microsoft.Office.Web.Common.Log' threw an exception. ---&gt; <strong>System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown</strong></span>.
at System.String.ReplaceInternal(String oldValue, String newValue)
at System.String.Replace(String oldValue, String newValue)
at Microsoft.Office.Web.Common.Log.GetQuotedEscapedStringOrNull(Object input)
at Microsoft.Office.Web.Common.Log.GetMessageForExceptionLogging(String verb, Exception originalException, Tuple`2[] info)
at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32 tag, String verb, Exception originalException, Tuple`2[] extraInfo)
at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32 tag, EventId id, Object[] insertionData)
at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32 tag, String verb, Exception originalException, Tuple`2[] extraInfo)
at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32 tag, EventId id, O...</pre>
&nbsp;
<pre>Log Name: Application
Source: .NET Runtime
Date: 21.09.2017 10:39:57
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: server
Description:
Application: Microsoft.Office.Web.AgentManager.exe Framework Version: v4.0.30319 Description: <span style="color: #ff0000">The process was terminated due to an unhandled exception. Exception Info: System.OutOfMemoryException</span> at System.String.ReplaceInternal(System.String, System.String) at System.String.Replace(System.String, System.String) at Microsoft.Office.Web.Common.Log.GetQuotedEscapedStringOrNull(System.Object) at Microsoft.Office.Web.Common.Log.GetMessageForExceptionLogging(System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceWithoutRetraceOnException(UInt32, System.String, System.Exception, System.Tuple`2&lt;System.String,System.Object&gt;[]) at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Common.Log.TraceTag(UInt32, Microsoft.Office.Web.Common.LogCategory, Level, System.String, System.Object[]) at Microsoft.Office.Web.Common.Log..cctor() Exception Info: System.TypeInitializationException at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32, Microsoft.Office.Web.Common.EventId, System.Object[]) at Microsoft.Office.Web.Environment.WacServer.AgentManager.AgentManagerApplication.CurrentDomain_UnhandledException(System.Object, System.UnhandledExceptionEventArgs)</pre>
&nbsp;
<pre>Log Name: Application
Source: Application Error
Date: 21.09.2017 10:39:59
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: server
Description:
Faulting application name: Microsoft.Office.Web.AgentManager.exe, version: 16.0.7329.1023, time stamp: 0x58145a49
Faulting module name: KERNELBASE.dll, version: 10.0.14393.1715, time stamp: 0x59b0d106
Exception code: 0xe0434352
Fault offset: 0x0000000000033c58
Faulting process id: 0x2f0
Faulting application start time: 0x01d332b51759f9e6
Faulting application path: C:\Program Files\Microsoft Office Web Apps\AgentManager\Microsoft.Office.Web.AgentManager.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: a6a0f8c7-52d1-4be5-aae9-ae4d627a0d4d
Faulting package full name: 
Faulting package-relative application ID:</pre>
<h3><span style="text-decoration: underline">Cause</span></h3>
Unfortunately, the error message "<span style="color: #ff0000">System.OutOfMemoryException" <span style="color: #000000">from the event log is misleading, as the root cause has nothing to do with memory :). Anyway, digging deeper in this issue by capturing a memory dump from the application "Microsoft.Office.Web.AgentManager.exe" showed the below:</span></span>

&nbsp;

!DumpObj /d 00000000112c0870
Name:        System.String
MethodTable: 00007ff8c7cc6948
EEClass:     00007ff8c75c50e0
Size:        1092544(0x10abc0) bytes
File:        C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll
String:      An exception was thrown while writing event. { originalException = "System.ArgumentException: <em><strong><span style="color: #ff0000">Only the first eight characters of a custom log name are significant, and there is already another log on the system using the first eight characters of the name given. Name given: 'Microsoft Office Web Apps', name of existing log: 'Microsoft-Windows-DSC/Operational'</span></strong></em>.
at System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData)
at System.Diagnostics.EventLogInternal.VerifyAndCreateSource(String sourceName, String currentMachineName)
at System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category)
at Microsoft.Office.ServiceInfrastructure.Runtime.EnvironmentAdapters.ANtEventLogAdapter.WriteEventEntry(EventLog log, Int32 id, EventLogEntryType type, String eventMessage, Int16 category)
at Microsoft.Office.ServiceInfrastructure.Runtime.EnvironmentAdapters.ANtEventLogAdapter.WriteEventTag(UInt32 tag, EventId id, Object[] insertionData)
at Microsoft.Office.Web.Common.Log.WriteEventTag(UInt32 tag, EventId id, Object[] insertionData)", insertionData : ["An exception was thrown while writing event. { originalException = \"System.ArgumentException: Only the first eight characters of a custom log name are significant, and there is already another log on the system using the first eight characters of the name given. Name given: 'Microsoft Office Web Apps', name of existing log: 'Microsoft-Windows-DSC/Operational'.
at System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData)
at System.Diagnostics.EventLogInternal.VerifyAndCreateSource(String sourceName, String currentMachineName)
at System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category)
at Microsoft.Office.ServiceInfrastructure.Runtime.EnvironmentAdapters.ANtEventLogAdapter.WriteEventEntry(EventLog log, Int32 id, EventLogEntryType type, String eventMessage, Int16 category)

&nbsp;

After checking the registry key location "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog", we noticed that it has the sub-key "<span style="color: #000000"><strong><em><span>Microsoft-Windows-DSC/Operational</span></em></strong></span>" which is preventing the creation of the registry key "<span style="color: #000000"><strong><em><span>Microsoft Office Web Apps</span></em></strong>". Honestly, we have no idea what created this key, as checking several machines in house did not show that key in this location.</span>

&nbsp;
<h3>Solution</h3>
Uninstall the software which created the conflicting registry key at "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog", or delete the key by yourself, and then re-run the command which should run successfully without any problem. Take into consideration that deleting this key will impact your software which created this registry key in the first place.

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>SharePoint Workflow Auto Cleanup</title>
      <link>https://docs.microsoft.com/archive/blogs/ahmedamin/sharepoint-workflow-auto-cleanup</link>
      <pubDate>Sun, 01 Oct 2017 18:03:08 GMT</pubDate>
      <dc:creator><![CDATA[Ahmed.Amin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ahmedamin/?p=525</guid>
      <description><![CDATA[I am not sure if this blog is really needed/helpful for someone or not, but we keep getting cases...]]></description>
      <content:encoded><![CDATA[I am not sure if this blog is really needed/helpful for someone or not, but we keep getting cases about <em><strong>workflow tasks being deleted</strong></em>, <em><strong>vanished</strong></em>, or <em><strong>deleted. </strong></em>Also, <em><strong>workflow status is gone</strong></em>!

&nbsp;

<em><strong><span style="text-decoration: underline">For SharePoint 2010 workflows (on SharePoint 2010/2013/2016)</span></strong></em>

Firstly, you should have known that we have SharePoint 2010 workflows on SharePoint 2013 and SharePoint 2016 which run by the SharePoint timer job and not handled by the fancy workflow manager. If you are still not sure what I am talking about, check the below screenshot from SharePoint 2013 site.

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/SharePoint2010Workflows.jpg"><img width="1024" height="734" class="alignnone size-large wp-image-535" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/SharePoint2010Workflows-1024x734.jpg" /></a>

What may happen that suddenly you will find that the completed/cancelled workflow instances are gone. In other words, you will find the workflow status column is empty as shown below:

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/DeletedWorkflowStatus.jpg"><img width="1024" height="220" class="alignnone size-large wp-image-545" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/DeletedWorkflowStatus-1024x220.jpg" /></a>

If you are sure that the workflow status was there, then this has been certainly deleted by the timer job <em><strong>Workflow Auto Cleanup</strong></em>. The job runs daily to <span style="color: #ff0000"><strong>permanently</strong> </span>deletes <span style="text-decoration: underline"><em><strong>workflow instances</strong></em></span><em> </em>and related <span style="text-decoration: underline"><em><strong>tasks</strong></em></span><em> </em>that still exist 60 days (default value) after a workflow is completed or canceled. <span style="text-decoration: underline"><em><strong>Workflow history items themselves are not deleted</strong></em></span>, but the entry point to view them on the status page for a particular instance of a workflow will no longer be available, as shown above. Therefore, if you access the workflow history list, you will find your workflow history records there, but bear in mind that the workflow history list is hidden; so, you have to access it by a direct URL.

&nbsp;

If needed, you can disable the Workflow Auto Cleanup job, if you want to keep workflow data available longer. However, <span style="text-decoration: underline"><em><strong>this is not recommended</strong></em></span>, as with any SharePoint list, as the workflow history and task lists grow in size, site performance may be compromised. If you are concerned about the size of these lists, keep the Workflow Auto Cleanup job enabled.

Reference: <a href="https://technet.microsoft.com/en-us/library/ee662522(v=office.14).aspx">https://technet.microsoft.com/en-us/library/ee662522(v=office.14).aspx</a>

&nbsp;

Disabling this timer job is not the only solution here, as you can increase the workflow instances/tasks retention by increasing the property SPWorkflowAssociation.AutoCleanupDays. The complete script can be found here <a href="https://blogs.msdn.microsoft.com/nishand/2007/09/11/changing-the-spworkflowassociation-autocleanupdays-property/">https://blogs.msdn.microsoft.com/nishand/2007/09/11/changing-the-spworkflowassociation-autocleanupdays-property/</a>

&nbsp;

<span style="text-decoration: underline"><em><strong>SharePoint 2013 Workflows</strong></em></span>

The situation for SharePoint 2013 workflows is different, as the workflow instances exist on the workflow manager database not on the SharePoint content database. Therefore, the timer job "Workflow Auto Cleanup" won't delete the workflow instances, but the workflow manager will :). How will this happen? And what's the retention for this?

&nbsp;

Actually, my colleague Felipe documented this here <a href="https://blogs.msdn.microsoft.com/feseca/2014/11/13/how-to-modify-retention-duration-for-workflow-instances-completed-in-workflow-manager/">https://blogs.msdn.microsoft.com/feseca/2014/11/13/how-to-modify-retention-duration-for-workflow-instances-completed-in-workflow-manager/</a>; so, for SharePoint 2013 workflows you should consider both settings: <span style="text-decoration: underline"><em><strong>Workflow Manager setting</strong></em></span>, and the <span style="text-decoration: underline"><em><strong>Workflow Auto Cleanup timer job</strong></em></span>. The workflow instances deletion will be done by the Workflow Manager from the workflow manager database, and the workflow status link on SharePoint will be deleted by the timer job.

&nbsp;

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Change SharePoint Service Account</title>
      <link>https://docs.microsoft.com/archive/blogs/ahmedamin/change-sharepoint-service-account</link>
      <pubDate>Sun, 01 Oct 2017 16:45:41 GMT</pubDate>
      <dc:creator><![CDATA[Ahmed.Amin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ahmedamin/?p=515</guid>
      <description><![CDATA[Normally, changing the SharePoint service accounts should not be a big deal. However, in our case we...]]></description>
      <content:encoded><![CDATA[Normally, changing the SharePoint service accounts should not be a big deal. However, in our case we had to do this using PowerShell, as we could not access the managed accounts page (Central Administration &gt;&gt; Security &gt;&gt; Configure Managed Accounts). Unfortunately, accessing it was giving us the below error:

&nbsp;
<pre><span style="color: #ff0000">Sorry, something went wrong </span>
<span style="color: #ff0000">Item has already been added. Key in dictionary: 'domain\spadmin'  Key being added: 'domain\spadmin'</span></pre>
&nbsp;

Frankly, the above error should be easy to be fixed by deleting one of the duplicate managed accounts using <a href="https://technet.microsoft.com/en-us/library/ff607697.aspx">Remove-SPManagedAccount</a>. However, doing so was failing as follows:

&nbsp;
<ul>
 	<li>Ran the below command to get domain\spadmin accounts that were existent on SharePoint.
<ul>
 	<li><em><strong>COMMAND</strong></em>
<pre>Get-SPManagedAccount "domain\spadmin" | select sid</pre>
</li>
 	<li><em><strong>RESULT</strong></em>
Sid
---
S-1-5-21-3855947664-3092534411-819001659-1127
S-1-5-21-3855947664-3092534411-819001659-2514</li>
</ul>
</li>
</ul>

<ul>
 	<li>Hence, we ran the below commands to delete the old duplicate account "domain\spadmin"
<ul>
 	<li><em><strong>COMMAND</strong></em>
<pre>$account = Get-SPManagedAccount | ?{$_.sid -eq "S-1-5-21-3855947664-3092534411-819001659-1127"}

$account.Delete()</pre>
</li>
 	<li><em><strong>RESULT</strong></em></li>
</ul>
</li>
</ul>
<p style="padding-left: 90px">Exception calling "Delete" with "0" argument(s): "The account domain\spadmin is still being used by these components:</p>
<p style="padding-left: 90px"><span style="color: #ff0000">Microsoft SharePoint Foundation Sandboxed Code Service</span></p>
<p style="padding-left: 90px"><span style="color: #ff0000">Security Token Service Application</span></p>
<p style="padding-left: 90px"><span style="color: #ff0000">Application Discovery and Load Balancer Service Application.</span>"</p>
<p style="padding-left: 90px">At line:1 char:1 + $account.Delete() + ~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException     + FullyQualifiedErrorId : InvalidOperationException</p>
&nbsp;

Based on the above error, the journey started...
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Changed the SharePoint farm account</strong> </em></span>by running the below command via SharePoint management shell.
<pre>stsadm.exe -o updatefarmcredentials -userlogin "domain\spadmin" -password "<mark>Password</mark>"</pre>
<span style="color: #ff0000">N.B., changed the above highlighted text with the farm account password</span></li>
</ul>
&nbsp;
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Change the SharePoint Service Applications Application Pools</strong></em></span>:
<ul>
 	<li>We ran the below command in order to list all the SharePoint Service Applications Application pools
<ul>
 	<li><strong>COMMAND</strong>
<pre>Get-SPServiceApplicationPool | format-list</pre>
</li>
 	<li><strong>RESULT</strong>
<ul>
 	<li>Name                        : SecurityTokenServiceApplicationPool
ProcessAccount              : <mark>S-1-5-21-3855947664-3092534411-819001659-1127</mark>
TypeName                    : Microsoft.SharePoint.Administration.SPIisWebServiceApplicationPool
DisplayName                 : SecurityTokenServiceApplicationPool
Id                          : ea6fdac5-f1d5-4284-8fc4-b70d633fac90
Status                      : Online
Parent                      : SPIisWebServiceSettings Name=SharePoint Web
Services
Version                     : 2852
Properties                  : {}
Farm                        : SPFarm Name=Sharepoint_Config
UpgradedPersistedProperties : {}
ProcessAccountName          :</li>
 	<li>Name                        : SharePoint Hosted Services
ProcessAccount              : S-1-5-21-3855947664-3092534411-819001659-1128
TypeName                    : Microsoft.SharePoint.Administration.SPIisWebServiceApplicationPool
DisplayName                 : SharePoint Hosted Services
Id                          : 6183b7e5-8939-474b-bbed-40f04a8c925a
Status                      : Online
Parent                      : SPIisWebServiceSettings Name=SharePoint Web
Services
Version                     : 9772
Properties                  : {}
Farm                        : SPFarm Name=Sharepoint_Config
UpgradedPersistedProperties : {}
ProcessAccountName          :</li>
 	<li>Name                        : SharePoint Search Application Pool
ProcessAccount              : S-1-5-21-3855947664-3092534411-819001659-1128
TypeName                    : Microsoft.SharePoint.Administration.SPIisWebServiceApplicationPool
DisplayName                 : SharePoint Search Application Pool
Id                          : ad785e4f-d5f3-4ec1-81c2-9ef6850381a9
Status                      : Online
Parent                      : SPIisWebServiceSettings Name=SharePoint Web
Services
Version                     : 10236
Properties                  : {}
Farm                        : SPFarm Name=Sharepoint_Config
UpgradedPersistedProperties : {}
ProcessAccountName          :</li>
 	<li>Name                        : SharePoint Web Services System
ProcessAccount              : <mark>S-1-5-21-3855947664-3092534411-819001659-1127</mark>
TypeName                    : Microsoft.SharePoint.Administration.SPIisWebServiceApplicationPool
DisplayName                 : SharePoint Web Services System
Id                          : a4007afd-aa3b-4a96-95be-7721cbf9357e
Status                      : Online
Parent                      : SPIisWebServiceSettings Name=SharePoint Web
Services
Version                     : 2883
Properties                  : {}
Farm                        : SPFarm Name=Sharepoint_Config
UpgradedPersistedProperties : {}
ProcessAccountName          :</li>
</ul>
</li>
</ul>
</li>
 	<li>As we are interested in the SID "S-1-5-21-3855947664-3092534411-819001659-1127", we ran the below commands via SharePoint management shell in order to replace the old service accounts with the new ones.
<pre>Set-SPServiceApplicationPool "SecurityTokenServiceApplicationPool" -Account "domain\spadmin"

Set-SPServiceApplicationPool "SharePoint Web Services System" -Account "domain\spadmin"</pre>
</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Change Sandboxed Code Service Service Account</strong></em></span>: we ran the below command via SharePoint management shell on the SharePoint server:
<pre>Get-SPServiceInstance | %{if($_.TypeName -eq "Microsoft SharePoint Foundation Sandboxed Code Service") {$_.Service.ProcessIdentity.Username ="domain\spadmin"; $_.Service.ProcessIdentity.Update(); $_.Service.ProcessIdentity.Deploy();}}</pre>
</li>
</ul>
&nbsp;

Hereafter, we deleted the account again using the below command via SharePoint management shell which ran successfully:
<pre>$account = Get-SPManagedAccount | ?{$_.sid -eq "S-1-5-21-3855947664-3092534411-819001659-1127"}
$account.Delete()</pre>
&nbsp;

Unfortunately, when we accessed the "Configure Managed Accounts" page via Central Administration, we got another error for another service account, as follows:
<pre><span style="color: #ff0000">Item has already been added. Key in dictionary: 'domain\spfarm'  Key being added: 'domain\spfarm'</span></pre>
<ul>
 	<li>Ran the below command to get spfarm accounts that were existent on SharePoint.
<ul>
 	<li><strong>COMMAND</strong>
<pre>Get-SPManagedAccount "domain\spfarm" | select sid</pre>
</li>
 	<li><strong>RESULT</strong>
Sid
---
S-1-5-21-3855947664-3092534411-819001659-1128
S-1-5-21-3855947664-3092534411-819001659-2516</li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>Hence, we found out that the old account SID is "S-1-5-21-3855947664-3092534411-819001659-1128"; Therefore, we ran the below commands to delete the managed account:
<ul>
 	<li><em><strong>COMMAND</strong></em>
<pre>$account = Get-SPManagedAccount | ?{$_.sid -eq "S-1-5-21-3855947664-3092534411-819001659-1128"}

$account.Delete()</pre>
</li>
 	<li><em><strong>RESULT</strong></em>
Exception calling "Delete" with "0" argument(s): "The account
domain\spfarm is still being used by these components:
<span style="color: #ff0000">Microsoft SharePoint Foundation Application Pool: mysite.com</span>
<span style="color: #ff0000"> User Profile Synchronization Service</span>
<span style="color: #ff0000"> Microsoft SharePoint Foundation Tracing</span>
<span style="color: #ff0000"> Distributed Cache</span>
<span style="color: #ff0000"> Microsoft SharePoint Foundation Application Pool: SharePoint – 80</span>
<span style="color: #ff0000"> SharePoint Server Search</span>
<span style="color: #ff0000"> Search Host Controller Service</span>
<span style="color: #ff0000"> Secure Store Service</span>
<span style="color: #ff0000"> PowerPoint Conversion Service Application</span>
<span style="color: #ff0000"> PerformancePoint Service</span>
<span style="color: #ff0000"> Excel Services Application</span>
<span style="color: #ff0000"> Subscription Settings Service</span>
<span style="color: #ff0000"> Business Data Connectivity Service</span>
<span style="color: #ff0000"> Work Management Service Application</span>
<span style="color: #ff0000"> Visio Graphics Service</span>
<span style="color: #ff0000"> Managed Metadata Service</span>
<span style="color: #ff0000"> Word Automation Services</span>
<span style="color: #ff0000"> User Profile Service Application</span>
<span style="color: #ff0000"> Search Administration Web Service for Search Service Application</span>
<span style="color: #ff0000"> Search Service Application</span>."
At line:1 char:1
+ $account.Delete()
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : InvalidOperationException</li>
</ul>
</li>
</ul>

<ul>
 	<li>Changing the Service Applications Application Pools was OK, and done using the same above commands Set-SPServiceApplicationPool.</li>
</ul>
&nbsp;
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Change User Profile Service Account</strong></em></span>: we ran the below command via SharePoint management shell
<pre>Get-SPServiceInstance | %{if($_.TypeName -eq "User Profile Synchronization Service") {$_.Service.ProcessIdentity.Username ="domain\spfarm"; $_.Service.ProcessIdentity.Update(); $_.Service.ProcessIdentity.Deploy();}}</pre>
</li>
</ul>

<ul>
 	<li><em><strong><span style="text-decoration: underline">Change the Distributed Cache Service Account</span>:</strong></em> , we ran the below commands:
<pre>$farm = Get-SPFarm

$cacheService = $farm.Services | where {$_.Name -eq "AppFabricCachingService"}

$accnt = Get-SPManagedAccount | ?{$_.sid -eq "<mark>S-1-5-21-3855947664-3092534411-819001659-2516</mark>"}

$cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser"

$cacheService.ProcessIdentity.ManagedAccount = $accnt

$cacheService.ProcessIdentity.Update()

$cacheService.ProcessIdentity.Deploy()</pre>
</li>
</ul>
<p style="padding-left: 30px"><span style="color: #ff0000">N.B., the above highlighted SID is the new account's SID</span></p>
&nbsp;
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Change the Tracing Service Service Account</strong></em></span>: we ran the below commands via SharePoint management shell.
<pre style="padding-left: 30px">$farm = Get-SPFarm

$tracingService = $farm.Services | where {$_.Name -eq "SPTraceV4"}

$managedAccount = Get-SPManagedAccount | ?{$_.sid -eq "<mark>S-1-5-21-3855947664-3092534411-819001659-2516</mark>"}

$tracingService.ProcessIdentity.CurrentIdentityType = "SpecificUser"

$tracingService.ProcessIdentity.ManagedAccount = $managedAccount

$tracingService.ProcessIdentity.Update()

$tracingService.ProcessIdentity.Deploy()</pre>
</li>
</ul>
<p style="padding-left: 30px"><span style="color: #ff0000">N.B., the above highlighted SID is the new account's SID</span></p>

<ul>
 	<li><span style="text-decoration: underline"><em><strong>Change Search Service Account</strong></em></span>: we ran the below commands via SharePoint management shell to replace the Search service account.
<pre style="padding-left: 30px">$procId = (Get-SPEnterpriseSearchService).get_ProcessIdentity()

$procId.CurrentIdentityType = "SpecificUser"

$myManagedAcount = Get-SPManagedAccount | ?{$_.sid -eq "<mark>S-1-5-21-3855947664-3092534411-819001659-2516</mark>"}

$procId.ManagedAccount = $myManagedAcount

$procId.Update()
</pre>
</li>
</ul>
<p style="padding-left: 30px"><span style="color: #ff0000">N.B., the above highlighted SID is the new account's SID</span></p>
&nbsp;
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Change the Search Host Controller Service Service Account</strong></em></span>: we ran the below commands via SharePoint management shell.
<pre style="padding-left: 30px">Get-SPServiceInstance | %{if($_.TypeName -eq "Search Host Controller Service") {$_.Service.ProcessIdentity.Username ="domain\spfarm"; $_.Service.ProcessIdentity.Update(); $_.Service.ProcessIdentity.Deploy();}}</pre>
</li>
</ul>
<ul>
 	<li><span style="text-decoration: underline"><em><strong>Change the SharePoint Web Applications Application Pools</strong></em></span>: we ran the below commands via SharePoint management shell:
<pre style="padding-left: 30px">$ManagedAccount = Get-SPManagedAccount | ?{$_.sid -eq "S-1-5-21-3855947664-3092534411-819001659-2516"}    

$WebApplication = Get-SPWebApplication | %{$_.ApplicationPool.ManagedAccount = $ManagedAccount; $_.ApplicationPool.Update();$_.ProvisionGlobally();$_.Update()}</pre>
</li>
</ul>
<ul>
 	<li>Eventually, we deleted the old managed account by running the below commands via SharePoint management shell:
<pre style="padding-left: 30px">$account = Get-SPManagedAccount | ?{$_.sid -eq "S-1-5-21-3855947664-3092534411-819001659-1128"}

$account.Delete()</pre>
</li>
</ul>
<span style="text-decoration: underline"><em><strong>One more observation</strong></em></span>:

The above resolved the managed account error "<span style="color: #ff0000">Item has already been added. Key in dictionary</span>"; However, we noticed some access denied errors on the SQL server logs, while investigating this issue. Digging deeper showed that the old service accounts have permissions on the SharePoint databases, but not the new accounts as both accounts have the same display name but different SIDs. Therefore, we ran the below commands on SQL server on all the SharePoint databases which changed the old user with the new user.
<pre>ALTER USER [domain\spadmin] WITH LOGIN = [domain\spadmin];

ALTER USER [domain\spfarm] WITH LOGIN = [domain\spfarm];</pre>
&nbsp;

Finally, to ensure that everything is OK, we ran the SharePoint Products Configuration Wizard on all the SharePoint servers.

&nbsp;

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>The permissions granted to user 'domain\user' are insufficient for performing this operation. ---&gt; Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'domain\user' are insufficient for performing this operation</title>
      <link>https://docs.microsoft.com/archive/blogs/ahmedamin/the-permissions-granted-to-user-domainuser-are-insufficient-for-performing-this-operation-microsoft-reportingservices-diagnostics-utilities-accessdeniedexception-the-permissions-grante</link>
      <pubDate>Wed, 20 Sep 2017 17:29:05 GMT</pubDate>
      <dc:creator><![CDATA[Ahmed.Amin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ahmedamin/?p=486</guid>
      <description><![CDATA[While using SQL Server Reporting Services (SSRS) with SharePoint, there are plenty of steps to be...]]></description>
      <content:encoded><![CDATA[While using SQL Server Reporting Services (SSRS) with SharePoint, there are plenty of steps to be considered. One of them is the permissions. From SharePoint's perspective, <a href="https://technet.microsoft.com/en-us/library/bb326286(v=sql.110).aspx">this article</a> clarifies this point.

&nbsp;

However, in my case the situation was kind of different. The SSRS reports were working fine on SharePoint, and suddenly they stopped! Whereas, if you open any report, you will get an error as follows:
<pre><span style="color: #ff0000">The permissions granted to user 'domain\user' are insufficient for performing this operation. ---&gt; Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'domain\user' are insufficient for performing this operation</span>.

&lt;detail&gt;&lt;ErrorCode xmlns="https://www.microsoft.com/sql/reportingservices"&gt;rsAccessDenied&lt;/ErrorCode&gt;&lt;HttpStatus xmlns="https://www.microsoft.com/sql/reportingservices"&gt;400&lt;/HttpStatus&gt;&lt;Message xmlns="https://www.microsoft.com/sql/reportingservices"&gt;The permissions granted to user 'domain\user' are insufficient for performing this operation. ---&amp;gt; Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'domain\user' are insufficient for performing this operation.&lt;/Message&gt;&lt;HelpLink xmlns="https://www.microsoft.com/sql/reportingservices"&gt;https://go.microsoft.com/fwlink/?LinkId=20476&amp;amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;amp;EvtID=rsAccessDenied&amp;amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;amp;ProdVer=11.0.3000.0&lt;/HelpLink&gt;&lt;ProductName xmlns="https://www.microsoft.com/sql/reportingservices"&gt;Microsoft SQL Server Reporting Services&lt;/ProductName&gt;&lt;ProductVersion xmlns="https://www.microsoft.com/sql/reportingservices"&gt;11.0.3000.0&lt;/ProductVersion&gt;&lt;ProductLocaleId xmlns="https://www.microsoft.com/sql/reportingservices"&gt;127&lt;/ProductLocaleId&gt;&lt;OperatingSystem xmlns="https://www.microsoft.com/sql/reportingservices"&gt;OsIndependent&lt;/OperatingSystem&gt;&lt;CountryLocaleId xmlns="https://www.microsoft.com/sql/reportingservices"&gt;1033&lt;/CountryLocaleId&gt;&lt;MoreInformation xmlns="https://www.microsoft.com/sql/reportingservices"&gt;&lt;Source&gt;Microsoft.ReportingServices.SharePoint.Server&lt;/Source&gt;&lt;Message msrs:ErrorCode="rsAccessDenied" msrs:HelpLink="https://go.microsoft.com/fwlink/?LinkId=20476&amp;amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;amp;EvtID=rsAccessDenied&amp;amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;amp;ProdVer=11.0.3000.0" xmlns:msrs="https://www.microsoft.com/sql/reportingservices"&gt;The permissions granted to user 'domain\user' are insufficient for performing this operation.&lt;/Message&gt;&lt;/MoreInformation&gt;&lt;Warnings xmlns="https://www.microsoft.com/sql/reportingservices" /&gt;&lt;/detail&gt;</pre>
&nbsp;

Checking The SharePoint ULS logs while reproducing this issue shows the below log records:

&nbsp;
<pre>xx/xx/xxxx xx:xx:xx.xx w3wp.exe (ITSRVAMSPAPP2:0x0D60) 0x26B4 SharePoint Foundation General adyrv High <span style="color: #ff0000">Cannot find site lookup info for request Uri</span> https://sp2013:32843/83dcde14cf16409295a8428c95c3573b<span style="color: #ff0000">/ReportStreaming.svc</span>. ab231a9e-7b93-e018-3466-ecf670f397df

xx/xx/xxxx xx:xx:xx.xx             w3wp.exe (ITSRVAMSPAPP2:0x0D60)     0x26B4 SharePoint Foundation  General 8xfr       Verbose              <span style="color: #ff0000">PermissionMask check failed. asking for 0x00010000, have 0x00000000 </span> ab231a9e-7b93-e018-3466-ecf670f397df

xx/xx/xxxx xx:xx:xx.xx             w3wp.exe (ITSRVAMSPAPP2:0x0D60)     0x26B4 SharePoint Foundation  General aix9j      High              SPRequest.GetSiteFlags: UserPrincipalName=, AppPrincipalName= ,bstrUrl=https://sp2013/sites/BI/PowerPivot Gallery/report.rdlx            ab231a9e-7b93-e018-3466-ecf670f397df

xx/xx/xxxx xx:xx:xx.xx             w3wp.exe (ITSRVAMSPAPP2:0x0D60)     0x26B4 SharePoint Foundation  General ai1wu   Medium              <span style="color: #ff0000">System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)), StackTrace:    at Microsoft.SharePoint.SPSite.get_ReadLocked()    </span> at Microsoft.ReportingServices.SharePoint.Server.SharePointServiceHelper.&lt;&gt;c__DisplayClass4.&lt;GetAdditionalToken&gt;b__3()     at Microsoft.SharePoint.SPSecurity.&lt;&gt;c__DisplayClass5.&lt;RunWithElevatedPrivileges&gt;b__3()     at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)     at Microsoft.ReportingServices.SharePoint.Server.Utility.RunElevated(CodeToRunElevated code)     at Microsoft.ReportingServices.SharePoint.Server.SharePointServiceHelper.GetAdditionalToken(String wssUrl, String userName)     at Microsoft.ReportingServices.SharePoint.Server.SharePointServiceHelper.PopulateAdditionalToken(RSService service, String wssUrl)     at Microsoft.ReportingServices.Library.StreamRequestHandler.ExecuteCommand()     at Microsoft.ReportingServices.ServiceRuntime.ReportStreaming.&lt;&gt;c__DisplayClasse.&lt;ExecuteStreamingOperation&gt;b__d()     at Microsoft.ReportingServices.ServiceRuntime.ReportStreaming.ExecuteStreamingOperation[TResult](Func`1 func)     at Microsoft.ReportingServices.ServiceRuntime.StreamBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)     at System.ServiceModel.Security.SecurityAppliedMessage.OnWriteMessage(XmlDictionaryWriter writer)     at System.ServiceModel.Channels.BinaryMessageEncoderFactory.BinaryMessageEncoder.WriteMessage(Message message, Stream stream)     at System.ServiceModel.Channels.HttpOutput.WriteStreamedMessage(TimeSpan timeout)     at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)     at System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.SendReplyCore(Message message, TimeSpan timeout)     at System.ServiceModel.Channels.HttpRequestContext.OnReply(Message message, TimeSpan timeout)     at System.ServiceModel.Channels.RequestContextBase.Reply(Message message, TimeSpan timeout)     at System.ServiceModel.Channels.SecurityChannelListener`1.SecurityRequestContext.OnReply(Message message, TimeSpan timeout)     at System.ServiceModel.Channels.RequestContextBase.Reply(Message message, TimeSpan timeout)     at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(MessageRpc&amp; rpc)     at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage9(MessageRpc&amp; rpc)     at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage8(MessageRpc&amp; rpc)     at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)     at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)     at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)     at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)     at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)     at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)     at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)     at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)     at System.ServiceModel.Channels.SecurityChannelListener`1.ReceiveItemAndVerifySecurityAsyncResult`2.InnerTryReceiveCompletedCallback(IAsyncResult result)     at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)     at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)     at System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item)     at System.Runtime.InputQueue`1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread)     at System.Runtime.InputQueue`1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread)     at System.ServiceModel.Channels.SingletonChannelAcceptor`3.Enqueue(QueueItemType item, Action dequeuedCallback, Boolean canDispatchOnThisThread)     at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)     at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)     at System.Runtime.AsyncResult.SyncContinue(IAsyncResult result)     at System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.BeginProcessInboundRequest(ReplyChannelAcceptor replyChannelAcceptor, Action dequeuedCallback, AsyncCallback callback, Object state)     at System.ServiceModel.Channels.HttpChannelListener`1.HttpContextReceivedAsyncResult`1.ProcessHttpContextAsync()     at System.ServiceModel.Channels.HttpChannelListener`1.BeginHttpContextReceived(HttpRequestContext context, Action acceptorCallback, AsyncCallback callback, Object state)     at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)     at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()     at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()     at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)     at System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state)     at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequestWithFlow(Object state)     at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)     at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)     at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)              ab231a9e-7b93-e018-3466-ecf670f397df

xx/xx/xxxx xx:xx:xx.xx             w3wp.exe (ITSRVAMSPAPP2:0x0D60)     0x26B4 SQL Server Reporting Services    Report Server Catalog    00000              Verbose              UnauthorizedAccessException in GetAdditionalToken : System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))     at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex)     at Microsoft.SharePoint.Library.SPRequest.GetSiteFlags(String bstrUrl)     at Microsoft.SharePoint.SPSite.get_ReadLocked()     at Microsoft.ReportingServices.SharePoint.Server.SharePointServiceHelper.&lt;&gt;c__DisplayClass4.&lt;GetAdditionalToken&gt;b__3()            ab231a9e-7b93-e018-3466-ecf670f397df</pre>
&nbsp;

Although the above error has a fix as documented in the above article, but our fix was slightly different.

&nbsp;

<span style="text-decoration: underline"><em><strong>Solution</strong></em></span>:

In order to fix this issue, we opened the Central Administration site, and navigated to <em><strong>Application Management</strong></em> &gt;&gt; <em><strong>Manage Service Applications</strong></em>, then selected the SSRS service application. From the ribbon, clicked on <em><strong>Administrators</strong> </em>icon. Hereafter, we found that the SSRS service account is already there and have Full Control permissions; so, we removed it and re-added it with Full Control permission which resolved the issue for good.

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/SSRS_MissingPermissions.jpg"><img width="769" height="1024" class="alignnone wp-image-495 size-large" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/SSRS_MissingPermissions-769x1024.jpg" /></a>

&nbsp;

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>SharePoint People Picker is Not Resolving Users in One-Way Trust</title>
      <link>https://docs.microsoft.com/archive/blogs/ahmedamin/sharepoint-people-picker-is-not-resolving-users-in-one-way-trust</link>
      <pubDate>Mon, 18 Sep 2017 18:19:14 GMT</pubDate>
      <dc:creator><![CDATA[Ahmed.Amin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ahmedamin/?p=465</guid>
      <description><![CDATA[Scenario:

You have your SharePoint farm in a domain, e.g. ahmedamin.local, and you have one-way...]]></description>
      <content:encoded><![CDATA[<span style="text-decoration: underline"><em><strong>Scenario</strong></em>:</span>

You have your SharePoint farm in a domain, e.g. ahmedamin.local, and you have one-way trust with another domain, e.g. contoso.local. Hereafter, you followed <a href="https://technet.microsoft.com/en-us/library/gg602075.aspx#section3">this article</a> and configured your People Picker to retrieve the users from the trusted domain contoso.local. However, while searching for any user from the trusted domain contoso.local, you get no results.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/sharepoint_peoplePicker_oneway_trust.jpg"><img width="1024" height="597" class="alignnone wp-image-466 size-large" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/sharepoint_peoplePicker_oneway_trust-1024x597.jpg" /></a>

&nbsp;

<span style="text-decoration: underline"><em><strong>Analysis:</strong></em></span>

While using the People Picker to resolve the user from the trusted domain, you collected SharePoint VerboseEx logs which showed the below error:
<pre>09/18/2017 07:18:47.02 w3wp.exe (0x1120) 0x2610 SharePoint Foundation Performance ftq1 Verbose <mark>SearchFromGC name = contoso.local. </mark>start  7e781a9e-5196-5016-c835-9eeac8346420

09/18/2017 07:18:47.02 w3wp.exe (0x1120) 0x2610 SharePoint Foundation General ardb5 Verbose SearchFromGC query = (|(&amp;(objectCategory=person)(|(anr=contoso*)(SamAccountName=contoso*)))(&amp;(objectCategory=group)(groupType:1.2.840.113556.1.4.803:=2147483648)(|(anr=contoso*)(SamAccountName=contoso*)))) 7e781a9e-5196-5016-c835-9eeac8346420

09/18/2017 07:18:58.32 w3wp.exe (0x1120) 0x2610 SharePoint Foundation Performance ftq3 Verbose SearchFromGC name = contoso.local. <span style="color: #ff0000">Error Message: Access is denied</span> 7e781a9e-5196-5016-c835-9eeac8346420

09/18/2017 07:18:58.32 w3wp.exe (0x1120) 0x2610 SharePoint Foundation General 7fbh Verbose <span style="color: #ff0000">Exception when search "contoso" from domain "contoso.local". Exception: "Access is denied"</span>, StackTrace: "   at <span style="color: #ff0000">Microsoft.SharePoint.Win32.SPNtDsApi32.SafeDirectoryServiceHandle.Bind</span>(String domainControllerName, String dnsDomainName)     at <span style="color: #ff0000">Microsoft.SharePoint.Win32.SPNtDsApi32.TranslateUserName</span>(String name, DS_NAME_FORMAT formatOffered, DS_NAME_FORMAT formatDesired)     at Microsoft.SharePoint.WebControls.PeopleEditor.SearchFromGC(SPActiveDirectoryDomain domain, String strFilter, String[] rgstrProp, Int32 nTimeout, Int32 nSizeLimit, SPUserCollection spUsers, ArrayList&amp; rgResults)     at Microsoft.SharePoint.Utilities.SPUserUtility.SearchAgainstAD(String input, Boolean useUpnInResolve, SPActiveDirectoryDomain domainController, SPPrincipalType scopes, SPUserCollection usersContainer, Int32 maxCount, String customQuery, String customFilter, TimeSpan searchTimeout, Boolean&amp; reachMaxCount)". 7e781a9e-5196-5016-c835-9eeac8346420</pre>
<span style="color: #ff0000">N.B., contoso.local is the trusted domain</span>

&nbsp;

As seen from the above ULS logs, this is failing with Access Denied error while contacting the trusted domain contoso.local. Specifically, this is failing while translating the returned usernames. Hence, if you collect network traces, you will find that SharePoint is sending LDAP query to the trusted domain which responds with the users. However, later SharePoint will try to contact the trusted domain again but with the SharePoint application pool account. As a result, this is going to fail with Access Denied error, as this is one-way trust and the SharePoint service account does not have permissions to access the trusted domain (contoso.local).

&nbsp;

But why SharePoint is contacting the trusted domain with its service account, and not with the people picker configured account?! - In fact, this happens when you use the people picker property <span style="text-decoration: underline"><em><strong>HideInactiveProfiles</strong></em></span>. So, what is this property?

&nbsp;

<em><strong>HideInactiveProfiles</strong> </em>is a people picker property that was introduced in <span style="text-decoration: underline"><em>SharePoint 2010 server (August 2012 CU)</em></span>. This property was only released to handle the below scenario:
<ul>
 	<li>You are in the process of migrating your user accounts from domain A to domain B. Whereas, you have two way trust between the two domains.</li>
 	<li>You migrate the users but keep the same SIDs. Later, you disable the migrated accounts in the destination domain B.</li>
 	<li>When a SharePoint user uses people picker to search for any of the migrated users, the people picker will return the user from domain B although the user is disabled.</li>
 	<li>In fact this happens because the people picker is using the Windows API LookupAccountSid to resolve the returned users' SIDs to domain\user. However, this API does not consider if the returned users are disabled or not.</li>
 	<li>Hence, with this property HideInactiveProfiles, SharePoint is not going to use this API LookupAccountSid, but will use distinguishedName.</li>
 	<li>Normally, if you want to enable this property "HideInactiveProfiles", you have to run the below STSADM command.</li>
</ul>
<pre style="padding-left: 30px">stsadm.exe -o setproperty -propertyname "HideInactiveProfiles" -propertyvalue "true"</pre>
<p style="padding-left: 30px"><span style="color: #ff0000">N.B., the above property and value are case sensitive, and the command works for SharePoint 2013, and SharePoint 2016</span></p>
&nbsp;

However, unfortunately, <span style="color: #ff0000"><em><strong><span style="text-decoration: underline">this property "HideInactiveProfiles" is not supported with one-way trust</span></strong></em></span>.

&nbsp;

<span style="text-decoration: underline"><em><strong>Solution:</strong></em></span>

In order to fix this issue, verify first that the property HideInactiveProfiles is enabled in your farm by running the below command
<pre>stsadm.exe -o getproperty -propertyname "HideInactiveProfiles"</pre>
&nbsp;

If it's enabled, and you have one-way trust, then you will need to disable it by running the below command, and then restart IIS.
<pre>stsadm.exe -o setproperty -propertyname "HideInactiveProfiles" -propertyvalue "false"


</pre>]]></content:encoded>
    </item>
    <item>
      <title>Is my SharePoint version fully supported by Microsoft?</title>
      <link>https://docs.microsoft.com/archive/blogs/ahmedamin/is-my-sharepoint-version-fully-supported-by-microsoft</link>
      <pubDate>Thu, 14 Sep 2017 18:02:40 GMT</pubDate>
      <dc:creator><![CDATA[Ahmed.Amin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ahmedamin/?p=455</guid>
      <description><![CDATA[In Microsoft while getting a SharePoint support case, the first thing that we have to check is the...]]></description>
      <content:encoded><![CDATA[In Microsoft while getting a SharePoint support case, the first thing that we have to check is the SharePoint farm version, and if it's fully supported or not. If you have a SharePoint farm, and you would like us to help/support you in any interactive issue that you have in your farm, you will need first to know if your SharePoint farm version is supported or not. As if your SharePoint farm version is not supported, then we may not be able to provide you with the right support.

&nbsp;

In other words, for each SharePoint (2010/2013/2016), we have a supported version that is shipped with the minimum fixes that we can start from to investigate your SharePoint farm issues. But <em><strong>how can you tell if your SharePoint version is supported or not?</strong></em>

&nbsp;

Easily, this can be checked using <a href="https://support.microsoft.com/en-us/lifecycle/search">this link</a>. Whereas, you can select your SharePoint product, and then check the supported version. For instance, we can check this against SharePoint Server 2013, as shown below:

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/SharePointSupportedVersion.jpg"><img width="2488" height="1092" class="alignnone wp-image-456 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/SharePointSupportedVersion.jpg" /></a>

&nbsp;

From the above, SharePoint Server 2013 is supported with Service Pack 1 since 04/14/2015. Hence, if you haven't yet installed Service Pack 1 for your SharePoint 2013 farm, you will need to do it ASAP.

<span style="color: #ff0000">P.S., as we are releasing updates for SharePoint regularly, the supported version of your SharePoint will vary from time to another. For instance, after a while the SharePoint supported version <em><strong>may</strong> </em>become Service Pack 2, and then your farm with Service pack 1 won't be supported!</span>

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>SharePoint Service Application is Stuck on Starting</title>
      <link>https://docs.microsoft.com/archive/blogs/ahmedamin/sharepoint-service-application-stuck-on-starting</link>
      <pubDate>Thu, 14 Sep 2017 14:41:31 GMT</pubDate>
      <dc:creator><![CDATA[Ahmed.Amin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ahmedamin/?p=445</guid>
      <description><![CDATA[Honestly, I've never experienced this issue in any preceding SharePoint versions, but only on the...]]></description>
      <content:encoded><![CDATA[Honestly, I've never experienced this issue in any preceding SharePoint versions, but only on the current version (SharePoint 2016). While creating one of the SharePoint service applications using the Central Administration site (Application Management &gt;&gt; Manage Service Applications), it eventually fails with timeout error. Thus, checking the Service Applications page on the Central Administration site shows that the service application is there, but its status is <span style="color: #ff0000"><em><strong>Starting!</strong></em></span>

&nbsp;

If you have a look on SharePoint ULS logs while the service application is being created, you will find similar records as the below:
<pre>xx/xx/xxxx xx:xx:xx.xx w3wp.exe 0x1AA0 SharePoint Foundation Topology fg4x High Ending <mark>asynchronous provisioning for service application with name 'BDC Service Application' and type 'Microsoft.SharePoint.BusinessData.SharedService.BdcServiceApplication'<span style="color: #333333;background-color: #ffffff">.</span></mark>

xx/xx/xxxx xx:xx:xx.xx w3wp.exe 0x1AA0 SharePoint Foundation Timer b9u7 High SPTimerJobAsyncResult '01d23aaf-7b11-4131-87e6-519b860597a9': <mark>Timer job has not completed.  Blocking until job completes</mark>.

xx/xx/xxxx xx:xx:xx.xx w3wp.exe 0x1AA0 SharePoint Foundation Timer b9u9 High SPTimerJobAsyncResult '01d23aaf-7b11-4131-87e6-519b860597a9': <mark><span style="color: #ff0000">An error occurred while waiting for completion</span>: System.Threading.ThreadAbortException: <span style="color: #ff0000">Thread was being aborted</span></mark>.     at System.Threading.Thread.SleepInternal(Int32 millisecondsTimeout)     at System.Threading.Thread.Sleep(Int32 millisecondsTimeout)     at Microsoft.SharePoint.Administration.SPJobDefinition.WaitForCompletion(TimeSpan timeout)     at Microsoft.SharePoint.Administration.SPTimerJobAsyncResult.WaitForCompletion(Object state)

xx/xx/xxxx xx:xx:xx.xx w3wp.exe 0x1AA0 SharePoint Foundation Runtime tkau Unexpected <mark>System.Web.HttpException: <span style="color: #ff0000">Request timed out</span></mark>.

xx/xx/xxxx xx:xx:xx.xx w3wp.exe 0x1AA0 SharePoint Foundation General ajlz0 High <mark>Getting Error Message for Exception System.Web.HttpException (0x80004005): Request timed out</mark>.</pre>
&nbsp;

Firstly, let's understand what happens under the hood while creating a new service application in SharePoint 2016. SharePoint 2016 is working based on the <em><strong>MinRole</strong></em> model which lets SharePoint farm administrators assign each server's role in a farm topology, and based on that, each server will run/host some of the farm services to be running on it. For full list of these services, please have a look on <span style="color: #3366ff;text-decoration: underline"><a href="https://technet.microsoft.com/en-us/library/mt667910(v=office.16).aspx">this article</a></span>.

Hence, while creating a new service application in SharePoint, SharePoint will check first your servers in the farm, and detect which servers will have to start the service application services on. For instance, in our case we were creating a BCS service application; so, SharePoint wanted to start the service instance <em><strong>Business Data Connectivity Service </strong></em>on any server with MinRole (Front-end, Application, Front-end with Distributed Cache, and Application with Search).

<span style="color: #ff0000">N.B., we knew the servers that the service instance will start on based on the lastly mentioned article searching for the MinRoles which should run the service Business Data Connectivity Service.</span><strong> </strong>

&nbsp;

Unfortunately, SharePoint won't complete the service application creation till the correspondent service instance is started on all the concerned servers in the farm. While waiting, if this is taking long time to start the service instance, the service application creation may timeout and cause this issue.

&nbsp;

<span style="color: #ff0000">N.B., noticed that installing Feature Pack 1 for SharePoint 2016 resolves this issue. If your farm is not patched with Feature Pack 1, install it.</span>

&nbsp;

<em><strong>The Solution</strong> </em>is simple, start the service instances on the concerned servers by yourself, and then create the service application. However, there are two things to be considered:
<ol>
 	<li>If you don't have the service application, you won't be able to start its service instance using the Central Administration site (System Settings &gt;&gt; Manage Services on Server), unless this is a Custom MinRole. Hence, we will <span style="text-decoration: underline">start the service instances using PowerShell</span>.</li>
 	<li>If the you don't have the service application, and you start the service instance, you will get a message beside the server in the Central Administration site (System Settings &gt;&gt; Manage Servers in this farm)that this server is not compliant! Beside this, you will find <span style="color: #3366ff;text-decoration: underline">fix</span> hyperlink, don't click it, as we will ignore this compliancy issue. Later, we will create the service application, and then the server will become compliant again.</li>
</ol>
<span style="color: #ff0000">N.B., if you already tried to create the service application, and it failed you will need to delete it before proceeding with the below steps.</span>

&nbsp;
<ol>
 	<li>Start the service instance
<ul>
 	<li>Firstly, check the above mentioned article to know which servers in your farm should run the required service instance.</li>
 	<li>Secondly, you will need to know the Type Name of your service instance of your service application; whereas, below is the type names of the SharePoint service instances:
<ul>
 	<li>Search Host Controller Service</li>
 	<li>Microsoft SharePoint Insights</li>
 	<li>App Management Service</li>
 	<li>Managed Metadata Web Service</li>
 	<li>Access Services</li>
 	<li>Business Data Connectivity Service</li>
 	<li>Request Management</li>
 	<li>Secure Store Service</li>
 	<li>Claims to Windows Token Service</li>
 	<li>Microsoft SharePoint Foundation Workflow Timer Service</li>
 	<li>PerformancePoint Service</li>
 	<li>Microsoft SharePoint Foundation Sandboxed Code Service</li>
 	<li>Visio Graphics Service</li>
 	<li>SharePoint Server Search</li>
 	<li>Document Conversions Launcher Service</li>
 	<li>Document Conversions Load Balancer Service</li>
 	<li>Search Query and Site Settings Service</li>
 	<li>Microsoft SharePoint Foundation Web Application</li>
 	<li>Central Administration</li>
 	<li>Microsoft SharePoint Foundation Incoming E-Mail</li>
 	<li>User Profile Service</li>
 	<li>Access Database Service 2010</li>
 	<li>Project Server Application Service</li>
 	<li>Microsoft SharePoint Foundation Subscription Settings Service</li>
 	<li>Lotus Notes Connector</li>
 	<li>Word Automation Services</li>
 	<li>PowerPoint Conversion Service</li>
 	<li>Machine Translation Service</li>
 	<li>Distributed Cache</li>
</ul>
</li>
 	<li>Once you know the servers to run the service instance on, and the type name of your service instance, run the below command via SharePoint management shell on any of your SharePoint servers.</li>
</ul>
</li>
</ol>
<pre style="padding-left: 90px">Get-SPServiceInstance | ?{$_.TypeName -eq "<mark>ServiceTypeName</mark>" -and $_.Server.Name -eq "<mark>ServerName</mark>"} | Start-SPServiceInstance</pre>
<p style="padding-left: 90px"><span style="color: #ff0000">N.B., change the above highlighted values with your service instance type name, and your server name respectively.</span></p>

<ol>
 	<li style="list-style-type: none">
<ul>
 	<li>After running the above command, run the below command and check the service instance status. It should eventually become <em><strong>Online</strong></em>. If not, you will need to investigate why it's not.</li>
</ul>
</li>
</ol>
<pre style="padding-left: 90px">Get-SPServiceInstance | ?{$_.TypeName -eq "<mark>ServiceTypeName</mark>" -and $_.Server.Name -eq "<mark>ServerName</mark>"}</pre>
<ol>
 	<li style="list-style-type: none">
<ul>
 	<li>After the service gets started (its status become Online), run the same above command to start the service instance on the remaining servers in the farm that are supposed to run the service instance based on their MinRoles.</li>
</ul>
</li>
 	<li>Create the service application normally using the UI from the Central Administration site (Application Management &gt;&gt; Manage Service Applications) or by using PowerShell.</li>
</ol>
&nbsp;

<span style="color: #ff0000">P.S., the same idea should work if you are deleting the service application and it fails with timeout. As deleting the service application will firstly stop the correspondent service instance before deleting the service application. If this is the case, stop the service instance manually on all the farm servers using SharePoint management shell (Stop-SPServiceInstance), and then delete the service application.</span>

&nbsp;

&nbsp;]]></content:encoded>
    </item>
  </channel>
</rss>