Showing posts with label Scripting. Show all posts
Showing posts with label Scripting. Show all posts

Wednesday, 6 July 2016

SharePoint 2013 Certificate Error Causes Performance Issues

Whilst working with a SharePoint 2013 environment I experienced slow page load times and poor search performance.  After initial page loads performance was fine for several minutes before the performance issue returned.

Opening the Application log within Event Viewer showed the following critical error with the text

“A certificate validation operation took 30015.2428 milliseconds and has exceeded the execution time threshold.  If this continues to occur, it may represent a configuration issue.  Please see http://go.microsoft.com/fwlink/?LinkId=246987 for more details.”

The fix for the problem is to export the SharePoint Root Authority certificate using PowerShell and import it into the Trusted Root Certificate store.  Open the SharePoint 2013 Management Shell as an administrator.

$SProotCert = (Get-SPCertificateAuthority).RootCertificate
$SProotCert.Export(“Cer”) | Set-Content C:\Test\SProotCert.cer –Encoding Byte

Open the Certificates MMC by opening a Run command and type MMC.  Choose File -> Add/Remove Snap-in.  Select the Certificates Snap-in and click Add.  On the next screen select Computer account and click Next followed by Local computer and Ok.



Right-click on Trusted Root Certificates and choose All Tasks -> Import



Complete the wizard by loading the certificate you exported using PowerShell.  Repeat the process on all SharePoint servers experiencing the issue.

These steps fixed the error on most of our SharePoint servers, but it remained on two.  In order to fix the error on the two remaining servers I configured proxy access through Internet Explorer, then from an elevated command prompt ran “netsh winhttp import proxy source=ie”  This configures Windows to use the IE proxy configuration as a default.  The servers were then able to access the internet and verify the certificates.

Thursday, 2 June 2016

Re-Create (Generate) SharePoint Root Authority "local" certificate

If your are looking to re-create (re-generate) your SharePoint Root Authority "local" certificate, here are the commands to do so...

I accidentally deleted mine, so I exported from other farm members

To Export:
-------------
$rootCert = (Get-SPCertificateAuthority).RootCertificate
$rootCert.Export("Cert") | Set-Content C:\Temp\FarmRoot.cer -Encoding byte

To Import:
-------------
$rootCert = Get-PfxCertificate C:\Temp\FarmRoot.cer
New-SPTrustedRootAuthority  -Certificate $rootCert

Tuesday, 3 March 2015

Sharepoint 2010 error opening .pdf files




When you try to open a PDF document from your standard SharePoint library, as it tries to open it in Acrobat viewer and you encounter the error:

There was an error opening this document. The filename, directory name, or volume label syntax is incorrect.

You can fix it read below:

DON'T


  • Change Client Integration
  • Change File handling methods

DO

Go to the following Path:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML

Edit the DOCICON.XML file 

Find this entry

<Mapping Key="pdf" Value="icpdf.png" OpenControl="PdfFile.OpenDocuments"/>




and edit it to 

<Mapping Key="pdf" Value="icpdf.png" OpenControl="SharePoint.OpenDocuments"/>





Hope this fixes your problem


Tuesday, 30 September 2014

SharePoint Default Trusted file (MIME) types

Each Web Application in SharePoint 2010 and 2013 has an AllowedInlineDownloadedMimeTypes property within which a list of trusted file (MIME) types exists. Firstly, there is no “untrusted” list, only a “trusted” list. It is safe to assume that if a MIME type is not included in this list, it is untrusted by default and is subject to the “X-Download-Options: noopen” HTTP Response header. The most common example of this is PDF documents, MIME type “application/pdf”. 


In the SharePoint 2010 Management Shell, you can easily find out which types are trusted out of the box by executing the following PowerShell snippet:


Get-SPWebApplication "http://yourwebapplicationurl" | Foreach-Object {$_.AllowedInlineDownloadedMimeTypes}


You could also use the following snippet to achieve the same output: 



$webApplication = Get-SPWebApplication "http://yourwebapplicationurl"            
$webApplication.AllowedInlineDownloadedMimeTypes


Again, it is important to note that each web application has its own AllowedInlineDownloadedMimeTypes property. 

Monday, 4 August 2014

Event ID 6398 due to CEIP Data Collection for SharePoint Foundation


If you have seen this error in your Job History, here is a workaround.

You can implement the following workaround to disable the CEIP Data Collection Job.

1.) Launch an elevated SharePoint 2010 Management Shell

2.) Run the following command to find out the current status of CEIP at the Farm and Site level

Get-SPBrowserCustomerExperienceImprovementProgram -Farm <- This will return the status of the Browser CEIP at the farm level
(Get-SPFarm).CEIPEnabled <- This will return the status of the CEIP at the farm level
(Get-SPWebApplication).BrowserCEIPEnabled <- This will return the status of the CEIP at the site level

3.) If CEIP is enabled, run the following commands to disable CEIP at the Farm and Site level

Set-SPBrowserCustomerExperienceImprovementProgram -Farm -Enable:$FALSE
Set-SPBrowserCustomerExperienceImprovementProgram -WebApplication "SBS SharePoint" -Enable:$FALSE

4.) Next, open SharePoint 2010 Central Administration

5.) Click System Settings

6.) Click Configure Privacy Options under Farm Management

7.) Under the section Customer Experience Improvement Program, select the radio button for 'No, I don't wish to participate.' and then click OK.

8.) Next, disable the CEIP Data Collection job by running the following command

Get-SPTimerJob job-ceip-datacollection | Disable-SPTimerJob

9.) Run IISRESET /noforce from an elevated command prompt.

Wednesday, 19 February 2014

New SharePoint 2010 Instance with Databases on your own naming convention

If you want to install a new SharePoint 2010 instance with Configuration database and Administration Content database with your own naming convention follow these simple steps:

first install all the SharePoint bits and once completed do not run the wizard.

open the SharePoint Management Shell

Run this command

PS C:\Users\administrator> psconfig.exe -cmd configdb -create -server
<Your SQL Server> -database <Config Database Name> -user <User> -password
<Password> -admincontentdatabase <Admin Content DB Name> -passphrase <Your Pass Phrase>

Once you have run this command you'll have your config and admin database with the names you have provided.