Your client does not support opening this list with Windows Explorer

Just a quick solution in case you ever get the following message when trying to open a SharePoint Document Library in explorer view from Windows Server 2008

Your client does not support opening this list with Windows Explorer.

This is due to the fact that Explorer view uses the WebDav protocol to connect to SharePoint from the client. As Windows Server is not designed to be a client, the WebDav client is not installed or enabled by default.

In order to enable the WebDav client on a server,simply enable the Desktop Experience feature.

Adobe iFilter for SharePoint 2010

Adobe PDF iFilter lets you index Adobe PDF documents in Microsoft SharePoint Server 2010 and Microsoft SharePoint Foundation 2010.

To install and configure Adobe PDF iFilter 9 in SharePoint Server 2010 and SharePoint Foundation 2010, follow these steps:

  1. Install Windows Server and SharePoint. This step includes the following tasks:
    • Install Windows Server 2008.
    • Install the SharePoint prerequisites. To do this, run the Microsoft SharePoint Products Preparation tool.
    • Install SharePoint 2010 and run the SharePoint Products Configuration Wizard.
    • Configure a server farm topology. For example, configure a Single Server Farm.
    • Create and configure a new Search Service application.
  2. Download and install Adobe PDF iFilter 9. For more information about how to download PDF iFilter 9, see Adobe PDF iFilter 9 on the Adobe Downloads website.

  3. Download the Adobe PDF file icon. For more information, see Use of Adobe icons and web logos on the Adobe website.

    Note Save the Adobe PDF file icon to the following file location:

    \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\
  4. Add the mapping entry to the docIcon.xml file. To do this, follow these steps:
    1. Open the docIcon.xml file in Notepad.

      Note The docIcon.xml file is located in the \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML folder.
    2. Type the following entry in the docIcon.xml file:

      <Mapping Key="pdf" Value="pdf16.gif" />
    3. Click Save.
    4. Exit Notepad.
  5. Add the .pdf file type to the SharePoint content index.
  6. Click Start, type regedit in the Search programs and files box, and then press Enter.
  7. Locate the following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension
  8. Right-click Extension, click New, and then click Key.
  9. Type .pdf, and then press Enter.
  10. Click .pdf, right-click (Default), and then click Modify.
  11. Type the following GUID in the Value data box:

    {E8978DA6-047F-4E3D-9C78-CDBE46041603}
  12. Exit Registry Editor.
  13. Restart the SharePoint Search Service.
  14. Restart all the SharePoint servers in the server farm.

PowerShell 2.0 Adding Columns to Document Libries in a Site Collection.

Adding Columns to a SharePoint List across an entire Site Collection should be done like this using PowerShell (with Power GUI):
 
Note that the use of the following works with all the defaults... 
$fieldDateTime = [Microsoft.SharePoint.SPFieldType]::DateTime
$list.Fields.Add("Compliance Date",$fieldDateTime,$false) 

However, you get MORE Control over Field Attributes using this method:
$fldXml = "<Field Type='DateTime' DisplayName='Report Sign Off Date' Format='DateOnly' Name='Report Sign Off Date'/>"     
$list.Fields.AddFieldAsXml($fldXml) 
 
Both methods are used in the code block below. 
if ((Get-PSSnapin | ? { $_.Name -eq "Microsoft.SharePoint.PowerShell" }) -eq $null) {
    Add-PSSnapin Microsoft.SharePoint.PowerShell
}
[Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges( 
{
 $site =  Get-SPSite -Identity "https://mysite.com/sites/thissite"
 Write-Host "Script Started"
 [array]$ListNames = "ListA", "ListB"
 $NumberofReportsinRecordFound = $false
 $ReportSignOffDateFound = $false
 $ComplianceDateFound = $false
 foreach($web in $site.AllWebs)
 {
  #Get number if Lists rather than using foreach as we will be modifying the List
  
  for($i=0; $i -lt $web.Lists.Count; $i++)
  {
   $list = $web.Lists[$i]
   if($list.BaseType -eq "DocumentLibrary" -and $list.BaseTemplate -notmatch "Catalog")
   {
    Write-Host $web.Title
    Write-Host $list
        
    $NumberofReportsinRecordFound = $false
    $ReportSignOffDateFound = $false
    $ComplianceDateFound = $false
      
    if($ListNames -contains $list.Title)
    {
     for($j=0; $j -lt $list.Fields.Count; $j++)
     {
      $field = $list.Fields[$j]
      if($field.Title -like "*do not use*")
      {
          Write-Host "do not use deleted!"
       $list.Fields.Delete($field)
       $list.Update() 
      }
      
      if($field.Title -like "Number of Reports in Record")
      {
       $NumberofReportsinRecordFound = $true
      }
      if($field.Title -like "Report Sign Off Date")
      {
       $ReportSignOffDateFound = $true
      }
      
      if($field.Title -like "Compliance Date")
      {
       $ComplianceDateFound = $true
      }
     }
        $fieldNumber = [Microsoft.SharePoint.SPFieldType]::Number

     if(!$NumberofReportsinRecordFound){
      $list.Fields.Add("Number of Reports in Record",$fieldNumber,$false)
      $fld = $list.Fields["Number of Reports in Record"]
     }
     
     if(!$ReportSignOffDateFound){
      $fldXml = "<Field Type='DateTime' DisplayName='Report Sign Off Date' Format='DateOnly' Name='Report Sign Off Date'/>"
      $list.Fields.AddFieldAsXml($fldXml)
     }
     
     if(!$ComplianceDateFound){
      $fldXml = "<Field Type='DateTime' DisplayName='Compliance Date' Format='DateOnly' Name='Compliance Date'/>"
      $list.Fields.AddFieldAsXml($fldXml)
     }
     $list.Description = "Inspection Reports"
     $list.Update()
    }
   }
  }
 }
 $web.Dispose()
 $site.Dispose()
 Write-Output "Script Ended"
}
)

Databases running in compatibility range, upgrade recommended.

When you apply a hot fix to SharePoint 2010 you need to run a command to complete the patch otherwise you will see this message in Central Admin "Databases running in compatibility range, upgrade recommended" under Upgrade and Migration -> Review database status, under the Status column.

To resolve this issue you need do the following.
1. Open an Administrative command prompt. CMD - Run as Administrator, or open the SharePoint PowerShell Command Window.
2. If running just the normal PowerShell Command Windows, change directory to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
3. Run PSConfig.exe -cmd upgrade

More information can be found here: http://technet.microsoft.com/en-us/library/cc263093.aspx

Hotfixes/Cummulative Updates: http://technet.microsoft.com/en-us/sharepoint/ff800847.aspx#LatestUpdates

SharePoint Error: "Additions to this Web site have been blocked."

I came across this error today! I'm not sure how this was set but someone must have set the "Site Collection Quotas and Locks" property to Read-only.

Central Admin -> Application Management -> Site Collections -> Configure quotas and locks.

and change this section to "Not locked". 

Hope this help someone!

HTTP to HTTPS Redirect on IIS7

Redirecting all HTTP traffic to HTTPS for a single site on IIS7 is as simple as the following steps.

1. Install Microsoft URL Rewrite Module if not already installed

2. Install your SSL certificate as Normal.
(Note that you need to keep a hostname-less port 80 entry in the Bindings, as well as port 443 for SSL, in order for the redirect to work.)

3. Add the following XML to your Web.Config file. 

  <system.webServer>
    <rewrite>
    <rules>
      <rule name="HTTP to HTTPS redirect" stopProcessing="true">
        <match url="(.*)" />
        <conditions>
          <add input="{HTTPS}" pattern="off" ignoreCase="true" />
        </conditions>
        <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
      </rule>
    </rules>
    </rewrite>
 </system.webServer>

4. Do a IISRESET

5. Test the URL to ensure http redirects to https. Also test not entering a http at all, just the website host name.

6. Done.

MVC3 deploy - Could not load file or assembly 'System.Web.WebPages.Razor

Whilst deploying my newly upgraded ASP.NET MVC 3 web application to the production environment I started receiving a FileNotFoundException with the error message "Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified." I have encountered this before so I know it is about bin-deploying that assembly. But where is the System.Web.WebPages.Razor assembly?

Since you have installed ASP.NET MVC 3 on your development machine you have all these MVC 3 assemblies installed in your GAC. Your production machine does not!

So you need to find this file and make it bin deployable however this cheeky assembly isn't in you solution so how can you do that? Well... add it. Go to Add Reference on your root web project (e.g. Web.csproj) and find System.Web.WebPages.Razor and add.

 

Now right click this assembly in your references directory and click properties.

Now you can make it bin deployable by setting Copy Local to true like so:

Note this is how to deploy the System.Web.WebPages.Razor assembly withe your ASP.NET MVC 3 web application. To deploy a typical setup of an ASP.NET MVC 3 app you will need to do the same for all of the following assemblies:

  • System.Web.Mvc
  • System.Web.Helpers
  • System.Web.Razor
  • System.Web.WebPages
  • System.Web.WebPages.Deployment
  • System.Web.WebPages.Razor as detailed above
  • Microsoft.Web.Infrastructure this will also need a reference added as above
  • WebMatrix.Data this also needs the reference


Of course you only need to add the reference to these assemblies if they are not already there - in most cases it will be. This was mainly a blog post for the slightly more complicated System.Web.WebPages.Razor.dll

Update

There is an easier way to do this if you are using Visual Studio 2010 Service Pack 1 and using Web Deploy as your publish action when publishing. You can add deployable dependencies to your ASP.NET MVC project that will choose the necessary assemblies for you. Even easier!