How to restrict mobile attachments to view only in Exchange Online

Introduction

This script will restrict mobile attachments to view only in Exchange Online.

Scenarios

This script will restrict mobile attachments to view only in Exchange Online.

Script

You can use this script in the following way.

1. Open Windows PowerShell.

2. Type the one command< Script Path> at the Windows PowerShell Console.
For example, type C:\Script\
EXORestrictMobileDevice.ps1

Here are some code snippets for your references.

PowerShell
Edit|Remove
Foreach($Policy in $PolicyList) 
{         
    Set-MobileDeviceMailboxPolicy -Identity $Policy.ID -AttachmentsEnabled $false 
} 
 
 

 

Examples

   Example: restrict mobile attachments to view only in Exchange Online.

The sample is showed below
EXORestrictMobileDevice.ps1 Credential $Credential

Prerequisites

Exchange Online
Windows PowerShell 2.0