Sharepont Best Warm Up

Today I will talk about a problem that almost all SharePoint administrators had once in their lifes, this is “The App Pools Recycle”.

Every night the App Pools of the SharePoint farm recycles automatically, causing that the first person that access to the portal, has to wait until the app pool warm back up, the worst part of this, is that people don’t like to wait. So what we can do?

I’m almost sure that you have surf the Internet, searching for PS codes, solutions or other kind of magic

But the other day I find a solution that fits very well with the farms that we deploy. This is a free solution, that you can find at Codeplex, and it’s very easy to use, install, whatever you want…

This is solution is https://spbestwarmup.codeplex.com/ if you are thinking this solution is mine you’re in the wrong way, only I’m posting this solution because I think that it works well, and why not to share it?

The solution consist in a Powershell script, that is it possible to execute it (there is another way??) and install it.

But wait, install a Powershell code? how? they have enough information in the web about how to do it, why and so on. I only have to say that once you have “installed the PS”, automatically it creates a task in Task Scheduler module which executes the PS each 30 min, great isn’t it?

e2

Also, it leaves a log record to be sure that the code has been executed well.

e1

So if you are having problems with first access in the farm or just simply curiosity, I encourage you to try it

Hope it helps!

SharePoint document library properties–The request was rejected by the HTTP filter

Weird error we have detected today. One of our platforms was published trough TMG, everything works fine when we tried to edit a column we got the following error:

“Error Code: 500 Internal Server Error. The request was rejected by the HTTP filter. Contact the server administrator.”

b1

Trying the same actions on any other list/library worked fine; just not for a document library.

The problem turned out to be related to HTTP filtering in TMG.

To fix the issue, Open the properties of the firewall policy.  Click Filtering > Configure HTTP under the Traffic tab.

b2

Uncheck Verify normalization.

b3

Save and apply changes and you should be all set.

Be aware that verify normalization will block URLs containing escaped characters after normalization.

Hope it helps!

People Picker: The request was rejected by the HTTP filter

Similar to the previous post I published about “Request Rejected” r error we discovered with publishing a SharePoint site through SharePoint, the people picker complained about the HTTP filter in TMG.

In the HTTP policy for the firewall rule for your web application, uncheck the value “Block high bit characters.”  This will fix the problem.

t4

 

Enterprise Search Center as SubSite

You want to create in SharePoint a SearchCenter as a subsite of the main site collection, but when you Access to site contents and add subsite, you realice that is not even posible to select the template of Advanced Search Center and only is possible to select the Basic Search Center.

s1

So what we can do?

To get the Enterprise search center template, you need to activate the site collection feature:

SharePoint Server Standard Site Collection features

s2

Once that’s activated, then you can create an enterprise search center as a subsite.

s3

Hope it helps!

Site slowness because of SharePoint STS certificate CRL checking

Assume that you have a web application that uses claims-based authentication, the SharePoint server does not have access to the Internet, or the server is protected by a firewall that has limited ports open. In this situation, users intermittently experience long delays when they perform certain operations, such as logging in to the site or performing a search. Users may also encounter HTTP timeouts when they perform these operations.

To resolve this issue, perform one of the following workarounds:

Workaround 1

Install the SharePoint Root Authority certificate in the Trusted Root Certification Authorities store. After the root certificate is added to the local certificate store, the certificate validation is no longer performed over the Internet. The below steps will cause the BuildChain to succeed by finding the certificate in the local store, therefore eliminating the need for the retrieval of an object from the network. The following steps have to be completed on each SharePoint server in the farm to add the root certificate to the local certificate store:

  1. Export the SharePoint Root Authority certificate as a physical (.cer) file. Start the SharePoint 2010 Management Shell as an Administrator,and then run the following Windows PowerShell commands:
  2. $rootCert = (Get-SPCertificateAuthority).RootCertificate

$rootCert.Export(“Cert”) | Set-Content C:SharePointRootAuthority.cer -Encoding byte

Note This will export the internal root certificate (.cer file) for SharePoint to Drive C. You can copy and use this file on all servers in the farm for importing without having to run the PowerShell commands again.

  1. Import the SharePoint Root Authority certificate to the Trusted Root Certification Authorities To add the SharePoint Root Authority certificate to the Trusted Root Certification Authorities store, follow these steps: Note “Administrators” is the minimum required group membership to complete these steps.
  2. Tap or click Start, type mmc in Start search, and then press Enter.
  3. On the File menu, click Add/Remove Snap-in.
  4. Under Available snap-ins, click Certificates, and then click Add.
  5. Under This snap-in will always manage certificates for, select Computer account, and then click Next.
  6. Select Local computer, and then click Finish.
  7. If you have no more snap-ins to add to the console, click OK.
  8. In the console tree, double-click Certificates.
  9. Right-click the Trusted Root Certification Authorities
  10. Click All Tasks, click Import to import the certificate, and then follow the steps in the Certificate Import Wizard.

Workaround 2

Disable the automatic update of root certificates on the SharePoint Servers. To do this, follow these steps:

  1. Under the Computer Configuration node in the Local Group Policy Editor, double-click Policies.
  2. Double-click Windows Settings, double-click Security Settings, and then double-click Public Key Policies.
  3. In the Details pane, double-click Certificate Path Validation Settings.
  4. Click the Network Retrieval tab, select the Define these policy settings check box, and then clear the Automatically update certificates in the Microsoft Root Certificate Program (recommended) check box.
  5. Click OK, and then close the Local Group Policy Editor.
  6. Run gpupdate /force to make the policy take effect immediately.

How To Install and Configure Adobe PDF iFilter in SharePoint 2010

  1. Download and install the PDF iFilter msi

http://www.adobe.com/support/downloads/detail.jsp?ftpID=5542

  1. Download the PDF file icon. http://www.adobe.com/legal/permissions/icons-web-logos.html
  2. Save the icon file gif to the following location:

C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14TEMPLATEIMAGES

  1. Add the mapping entry to the docIcon.xml file located :Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14TEMPLATEXML

 <Mapping Key=”pdf” Value=”pdficon.gif” OpenControl=””/>

  1. Add the pdf extension to the File Types of the Search Application Service
  2. Using regedit, navigate to:

\HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupFilters

Add the following values to this key:

<REG_SZ> Default = <value not set> <REG_SZ> Extension = pdf <REG_DWORD> FileTypeBucket = 1 <REG_SZ> MimeTypes = application/pdf

You can also use Powershell to create the keys and values:

New-Item -path registry::’HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupFilters.pdf’ | Out-Null

New-ItemProperty -Path registry::’HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupFilters.pdf’ -Name “Extension” -value “.pdf” -PropertyType string | Out-Null

New-ItemProperty -Path registry::’HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupFilters.pdf’ -Name “Mime Types” -value “application/pdf” -PropertyType string | Out-Null

New-ItemProperty -Path registry::’HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupFilters.pdf’ -Name “FileTypeBucket” -value “1” -PropertyType dword | Out-Null

  1. Using regedit, navigate to:

 \HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupContentIndexCommonFiltersExtension

Right-click the Filters folder and select New key. Enter “.pdf” for the key value and set the default value to {E8978DA6-047F-4E3D-9C78-CDBE46041603}

And again, you can also use Powershell to create the key and value:

New-Item -Path registry::’HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupContentIndexCommonFiltersExtension.pdf’ | Out-Null

New-ItemProperty -Path registry::’HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice Server14.0SearchSetupContentIndexCommonFiltersExtension.pdf’ -name “(Default)” -Value “{E8978DA6-047F-4E3D-9C78-CDBE46041603}” -PropertyType string | Out-Null

Restart the SharePoint Search Service

Get Size of all Sub-sites in a Site Collection

Today I will post about how to obtain the size of all the subsits in a site collection, sometimes a customer ask for something like that and it’s pretty easy to obtain it.

The only work to do is to open a Sharepoint Shell, configure the url in the above code, and paste it in the shell. Then you will obtain a file with the url of each site and the total size of each them.
[void][System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
# Function to calculate folder size
Function CalculateFolderSize($Folder)
{
[long]$FolderSize = 0
foreach ($File in $Folder.Files)
{
#Get File Size
$FolderSize += $file.TotalLength;
#Get the Versions Size
foreach ($FileVersion in $File.Versions)
{
$FolderSize += $FileVersion.Size
}
}

#Iterate through all subfolders
foreach ($SubFolder in $Folder.SubFolders)
{
#Call the function recursively
$FolderSize += CalculateFolderSize $SubFolder
}

return $FolderSize
}

$SiteURL = “http://urlwebapp&#8221;
$Site = new-object Microsoft.SharePoint.SPSite($SiteURL)
foreach($Web in $Site.AllWebs)
{
#Call function to calculate Folder Size
[long]$WebSize = CalculateFolderSize($Web.RootFolder)
#Get Recycle Bin Size
foreach($RecycleBinItem in $Web.RecycleBin)
{
$WebSize += $RecycleBinItem.Size
}
$Size = [Math]::Round($WebSize/1MB, 2)
$web.Url+” : “+$Size+” MB” >> sitesizereport.txt
}

That’s all, hope it helps!

Office Web Apps 2013: Delete extension

This post will explain how to remove an Office Web Apps extension to not to do previews in Shareoint 2013.

In this case, we will remove an entire “OneNote” application, but of course it ca be done at doctype level.

First of all, is it necessary to open as administrator an Sharepoint 2013 Shell and type the following:

remove-spwopibinding -application “Onenote”

In case we want to re-add the application removed, we have to type the following:

new-spwopibinding -application “onenote” -servername “OWAServerName”

Hope it helps!

Enable Developer Dashboard

Today I will post something pretty easy to use, but for SharePoint Administrators is synonim of performance problems in our farms: The Developer Dashboard

To Enable the developer dashboard, we have to open a SharePoint Powershell Shell and type the following:

$content = ([Microsoft.SharePoint.Administration.SPWebService]::ContentService)
$appsetting =$content.DeveloperDashboardSettings
$appsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On
$appsetting.Update()

We have to be aware that this module only will be visibe to people who are site collection administrator

Of course, if we want to disable the developer dashboard,type the following:

$content = ([Microsoft.SharePoint.Administration.SPWebService]::ContentService)
$appsetting =$content.DeveloperDashboardSettings
$appsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off
$appsetting.Update()

Hope it helps!

Dealing with orphaned user solutions

I’m surprised this problem isn’t more common. It seems easy enough to trigger by accident, and fixing it was a puzzle.

No doubt most of us have at some point in using SharePoint 2010 created a site template, and then after gazing upon it in the Solution Gallery, determined that we’ve named it wrong, need to change one small thing, or any number of different issues. Normally, the correct thing to do in this circumstance is to deactivate and then delete the solution.

What if you don’t deactivate it?

Create a site.
Save it as a template to the Solution Gallery.
Download the WSP to your desktop.
Delete the solution from the Solution Gallery *without* deactivating it. To do this, click the Edit button and then click Delete from there.
Upload the WSP back to the Solution Gallery.

You’ll find that you’re not able to activate the WSP you just uploaded, or deactivate it. And now you’re just kinda stuck with a site template that’s visible when you try to create a new site, but nothing that can be done about it!

So, first off, user solution WSPs still contain features. We *can* deactivate the feature that installs this site template (via PowerShell).

1
2
3
$site = Get-SPSite http://my.site.com
$site.Features | Where-Object {$_.FeatureDefinitionScope -eq "Site"}
Disable-SPFeature $feature -url http://my.site.com

But that’s only hiding the problem, it’s not actually fixing it. So, we should try to identify the user solution and remove it instead.

1
Uninstall-SPUserSolution -Identity "BasicProjectSite.wsp" -Site http://my.site.com

But this tells me that there is no solution with that name. But when I list $site.Solutions, it’s there. Even running Get-SPUserSolution lists 0 solutions. What to do? Wait, does the object model still work?

1
2
3
4
5
6
Name                           SolutionId                           Status
----                           ----------                           ------
BasicProjectSite.wsp           af9fc924-26b1-4c4f-9250-57b26c81316f Activated
 
$solution = $site.Solutions[[guid]"af9fc924-26b1-4c4f-9250-57b26c81316f"]
$site.Solutions.Remove($solution)

And it’s finally gone!