Add PDF mimetype for all Web Applications one-liner


By default, PDF files cannot be opened directly from SharePoint 2010/SharePoint 2013.

To add the PDF mimetype to all Web Applications (Instead of doing it seperately for each Web Application), you can use the following one-liner:

Get-SPWebApplication | %{$_.AllowedInlineDownloadedMimeTypes.Add("application/pdf");$_.Update()}
About these ads

6 Responses to Add PDF mimetype for all Web Applications one-liner

  1. haydenhancock says:

    Very useful PowerShell command! Thanks for sharing!

  2. Nico Martens says:

    Hi Ron,

    Yes that script will work great aswell. Mine is just to add the pdf mimetype for all Web Applications. The script you pointed out gives you multiple options to add additional mimetypes to specific Web Applications

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: