Outlook Web Access maintain a list of allowed and blocked file types. These are contained in a policy for each user. To determine what this policy is with PowerShell, the first thing you’ll need to do is connect to Exchange Online. I have made that easy for you by creating a script to connect using the new Exchange Online V2 PowerShell module. you will find that script here:
Once you have connected, run the following commands:
$casmailbox=Get-CASMailbox <user email address>
$owapolicyname = $casmailbox.OwaMailboxPolicy
This should display something like:
which gives us the policy name.
Next run the command:
$policy = Get-OwaMailboxPolicy $owapolicyname
to get the settings/values of that policy.
To view the allowed file list run the commands:
$allowedFileTypes = $policy.AllowedFileTypes
which should show something like:
To view the blocked file list run the commands:
$blockedfiletypes = $policy.BlockedFileTypes
The next question is, can you adjust these lists? Yes you can. You basically do that by adjusting the list of extensions variable (here $blockedfiletypes) via something like:
and reapplying that to the policy like:
Set-OwaMailboxPolicy $policy -BlockedFileTypes $blockedFileTypes
and if you want to extend the list just use add instead of remove in the above command prior to applying it to the policy.
Microsoft is making additions to the BlockedFileTypes list from April 2020:
What file extensions will be added to the BlockedFileTypes list with this change?
The following extensions are used by the Python scripting language:
“.py”, “.pyc”, “.pyo”, “.pyw”, “.pyz”, “.pyzw”
The following extensions are used by the PowerShell scripting language:
“.ps1”, “.ps1xml”, “.ps2”, “.ps2xml”, “.psc1”, “.psc2”, “.psd1”, “.psdm1”, “.cdxml”, “.pssc”
The following extension is used by Windows ClickOnce
The following extension is used by Microsoft Data Access Components (MDAC)
The following extension is used by the Windows sandbox
The following extensions are used for digital certificates:
“.cer”, “.crt”, “.der”
The following extensions are used by the Java programming language:
The following extensions are used by various applications. While the associated vulnerabilities have been patched (for years, in most cases), they are being blocked for the benefit of organizations that might still have older versions of the application software in use:
“.appcontent-ms”, “.settingcontent-ms”, “.cnt”, “.hpj”, “.website”, “.webpnp”, “.mcf”, “.printerexport”, “.pl”, “.theme”, “.vbp”, “.xbap”, “.xll”, “.xnk”, “.msu”, “.diagcab”, “.grp”
The list in my test tenant right now is:
Blocked File Types:
and Allowed File Types is:
Your mileage may vary.