Tuesday 30 September 2014

SharePoint Default Trusted file (MIME) types

Each Web Application in SharePoint 2010 and 2013 has an AllowedInlineDownloadedMimeTypes property within which a list of trusted file (MIME) types exists. Firstly, there is no “untrusted” list, only a “trusted” list. It is safe to assume that if a MIME type is not included in this list, it is untrusted by default and is subject to the “X-Download-Options: noopen” HTTP Response header. The most common example of this is PDF documents, MIME type “application/pdf”. 


In the SharePoint 2010 Management Shell, you can easily find out which types are trusted out of the box by executing the following PowerShell snippet:


Get-SPWebApplication "http://yourwebapplicationurl" | Foreach-Object {$_.AllowedInlineDownloadedMimeTypes}


You could also use the following snippet to achieve the same output: 



$webApplication = Get-SPWebApplication "http://yourwebapplicationurl"            
$webApplication.AllowedInlineDownloadedMimeTypes


Again, it is important to note that each web application has its own AllowedInlineDownloadedMimeTypes property. 

Force Browser to save office files locally

if you are stuck like me and trying to find a solution to force browsers to only save office documents (word and excel) locally and not try to open in browser follow the steps below:


$webApplication = Get-SPWebApplication "http://localhost"
$webApplication.AllowedInlineDownloadedMimeTypes.Remove("application/vnd.openxmlformats-officedocument.wordprocessingml.document")
$webApplication.AllowedInlineDownloadedMimeTypes.Remove("application/msword")
$webApplication.AllowedInlineDownloadedMimeTypes.Remove("application/vnd.ms-word.document.12")
$webApplication.AllowedInlineDownloadedMimeTypes.Remove("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
$webApplication.Update()

Wednesday 24 September 2014

Configure outgoing email for a farm

You can configure outgoing email for a farm by using the SharePoint Central Administration website. Use the following procedures to configure outgoing email. After you complete the procedures, users can track changes and updates to individual site collections. In addition, site administrators can, for example, receive notices when users request access to a site.
To configure outgoing email for a farm by using Central Administration
  1. Verify that the user account that is performing this procedure is a member of the Farm Administrators group on the server that is running the SharePoint Central Administration website.
  2. In Central Administration, click System Settings.
  3. On the System Settings page, in the E-Mail and Text Messages (SMS) section, click Configure outgoing e-mail settings.
  4. On the Outgoing E-Mail Settings page, in the Mail Settings section, type the SMTP server name for outgoing email (for example, mail.example.com) in the Outbound SMTP server box.
  5. In the From address box, type the email address as you want it to be displayed to email recipients.
  6. In the Reply-to address box, type the email address to which you want email recipients to reply.
  7. In the Character set list, select the character set that is appropriate for your language.
  8. Click OK.