How to enable Office 365 message encryption

Introduction

This script is used to help to enable Information Rights-Management service for Exchange Online.

Prerequisites

This script requires Windows Azure AD Rights Management Administration Tool. Please download and install the package from Microsoft Download Center. This script cannot work correctly without this package.

Scenarios

This script is used to help to enable Information Rights-Management service for 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\ EnableIRMforEXO

Here are some code snippets for your references.

PowerShell
Edit|Remove
Import-RMSTrustedPublishingDomain -RMSOnline -name "RMS Online"
$resultstring = Test-IRMConfiguration -RMSOnline
[regex]$reg = "(?<=OVERALL RESULT:\s)\w+\b"
$result = $reg.Match($resultstring.Results).value
if($result -eq 'fail')
{
    Write-Host "Please run 'Set-IRMConfiguration -InternalLicensingEnabled $true' later "
    Exit
}
Set-IRMConfiguration -InternalLicensingEnabled $true

Examples

  Example: Enable the IRM for Organization.

EnalbeIRMforExo.ps1 -Location Asia -Credential $Cred

Result Screenshot:

After the script executed, user can enable encryption when sending email.

 

 

 

Microsoft All-In-One Script Framework is an automation script sample library for IT Professionals. The key value that All-In-One Script Framework is trying to deliver is Scenario-Focused Script Samples driven by IT Pros' real-world pains and needs. The team is monitoring all TechNet forums, IT Pros' support calls to Microsoft, and script requests submitted to TechNet Script Repository. We collect frequently asked IT scenarios, and create script samples to automate the tasks and save some time for IT Pros. The team of All-In-One Script Framework sincerely hope that these customer-driven automation script samples can help our IT community in this script-centric move.