Resolving SharePoint 2010 PDF Issues with PowerShell

PDF’s that have been uploaded to your SharePoint 2010 document libraries do not show the correct icon and only give you the option of saving instead of opening them:

The following PowerShell script downloads a 17×17 GIF image from named pdficon_small.gif, places it in the images folder under the 14 hive, associates it in the DOCICON.XML file, sets Browser File Handling to Permissive, and then runs IISReset:


The first part of the script downloads a pdf icon from to the Images folder:

The second part associates PDF’s in SharePoint with this PDF GIF image icon file:

The third portion of the script sets the Browser File Handling to Permissive so that the PDF’s are able to be opened instead of only saved. This was implemented on an Intranet SharePoint server so I consider this decrease in security to be an acceptable risk:

The last thing it does is run IISReset:

PDF’s now have the correct icon and are allowed to be opened:

The PDF icon issue and information about associating it in SharePoint is documented in this Microsoft KB Article.



  1. Oliver Van Camp (@olivervancamp)


    A more elegant (and secure) way to enable opening PDF files is by adding the pdf extension to the allowed MIME types of the web application:

    $webapp = Get-SPWebApplication

    Great script, btw: one for the SP Admin toolbox!!




Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: