Install PDF Filter Using PowerShell in SharePoint

SharePoint 2010 doesn’t support PDF files by default. You can solve this by installing Adobe PDF iFilter 9 for 64-bit platforms and following the steps described below. First, you can download PDFFilter64installer.msi: http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025

You’ll also need an icon that will be used in SharePoint 2010 for PDF files: http://www.mossgurus.com/adnan/Documents/pdf16.gif

Next, start PowerShell and run the following command to install the MSI Package and configure SharePoint 2010:

# Install MSI
PS > $iFilter = C:\Media\IFilter\PDFFilter64installer.msi”
PS > Start-Process -FilePath $IFIlter -ArgumentList "/quiet" Wait

# Copy Icon to SharePoint Folder
PS > $icon = C:\Media\IFilter\pdf16.gif”
PS > Copy-Item -Path $Icon -Destination "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES"

# Modify DocIcon.xml
PS > $path = "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML\DOCICON.XML"
PS > $xml = New-Object XML
PS > $xml.Load($path)
PS > $element = $xml.CreateElement("Mapping")
PS > $element.SetAttribute("Key","pdf")
PS > $element.SetAttribute("Value","pdf16.gif")
PS > $xml.DocIcons.ByExtension.AppendChild($element) | Out-Null
PS > $xml.Save($path)

# Add PDF type to Search Service Application
PS > New-SPEnterpriseSearchCrawlExtension -Name "pdf" `
>> -SearchApplication SearchServiceApp

# Modify Registry
PS > mkdir 'HKLM:\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf'
PS > Get-Item 'HKLM:\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf' | >> Set-ItemProperty -Name "(default)" `
>> -Value "{E8978DA6-047F-4E3D-9C78-CDBE46041603}"

# Restart Search Service
Get-Service | Where-Object { $_.Name -eq "OSearch14" } | 
>> Restart-Service

Twitter This Tip! ReTweet this Tip!


Posted Apr 11 2012, 06:00 AM by sos

Comments

Install PDF Filter Using PowerShell in SharePoint – SharePoint Tips … | Mastering Sharepoint wrote Install PDF Filter Using PowerShell in SharePoint – SharePoint Tips … | Mastering Sharepoint
on 04-19-2012 5:46 AM

Pingback from  Install PDF Filter Using PowerShell in SharePoint – SharePoint Tips … | Mastering Sharepoint

Idera SharePoint Reviews SMBology, Inc. Rackspace Hosting Sponsored by Idera and SharePoint Reviews and SMBology and EPCGroup.net
Copyright 2011 SecretsOfSharePoint.com. All rights reserved.