SharePoint 2016 Manage Block File Types

You can restrict the file types from being uploaded or downloaded in SharePoint 2013. Each web application maintains a list of the blocked file types that is based on file name extensions. Today, I will walk through the process / steps to manage the Block File types in SharePoint 2016. We can manage them via Central Admin or PowerShell.

Scenario

In our company, there is a requirement to block the ‘EXE’ file extensions from being uploaded to SharePoint.

Manage the file types, using Central Administration.

Here are the steps.

  1. Log on to Central Admin's Website, using the Farm Administrator account.
  2. In Central Administration, click Security.
  3. On the Security page, in the General Security section, click Define blocked file types.



  4. On the Blocked File Types page, if you want to change the selected Web Application(1) on the Web Application menu, click Change Web Application. Use the Select Web Application page to select a Web Application.

  5. Do one of the following,

    1. To Block
      To block an additional file type, scroll to the bottom of the Type each file name extension on a separate line text box, type the file name extension(2), which you want to block and then click OK(3).

    2. To Remove
      To stop blocking a file type, select a file type from the list, press Delete key and then click OK.

Note

You do not have to type a file name extension in the list in alphabetical order. The next time that you open the list, the file name extension you added will be correctly sorted in an alphabetical order.

Manage the File Types Using PowerShell

Please follow the steps, mentioned below.
  • Launch SharePoint PowerShell Windows as “Run as Administrator”.

To View Existing Block File Extension

In PowerShell Windows, please run the command, mentioned below.

  1. $webapp = Get-SPWebApplication “Url of the Web Application”  
  2. $ext = $webapp.BlockedFileExtensions  
  3. Write-Host “List of Block File extensions are” $ext -ForegroundColor “Blue”  
To add an existing Block File ExtensionIn PowerShell Window, please run the command, mentioned below.

In PowerShell windows please run the following command.
  1. $webapp = Get-SPWebApplication “Url of the Web Application”  
  2. $ext = $webapp.BlockedFileExtensions  
  3. $ext.Add(“exe”)  
  4. $webapp.update()  
To Remove Existing Block File Extension

In PowerShell Windows, run the command, mentioned below.
  1. $webapp = Get-SPWebApplication “Url of the Web Application”  
  2. $ext = $webapp.BlockedFileExtensions  
  3. $ext.Remove(“exe”)  
  4. $webapp.Update()  
For complete code, please visit the Technet Gallery at SharePoint 2016 Block File Type Operations PowerShell.

 

Ebook Download
View all
Learn
View all