Advanced Office 365 Message Encryption (OME) Usage Example with a custom branding template!

%3CLINGO-SUB%20id%3D%22lingo-sub-2812341%22%20slang%3D%22en-US%22%3EAdvanced%20Office%20365%20Message%20Encryption%20(OME)%20Usage%20Example%20with%20a%20custom%20branding%20template!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2812341%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDear%20Microsoft%20365%20Friends%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20example%20is%20about%20using%20OME%20(Office%20Message%20Encryption)%20with%20a%20custom%20template.%20Whenever%20an%20email%20is%20sent%20to%20a%20specific%20domain%20(outlook.com%20in%20my%20example)%2C%20the%20email%20should%20be%20encrypted%20and%20equipped%20with%20the%20custom%20template.%20The%20recipient%20can%20then%20decrypt%20the%20content%20with%20an%20OTP%20(one-time%20pass%20code).%3C%2FP%3E%0A%3CP%3ETo%20work%20with%20Advanced%20Office%20365%20Message%20Encryption%20you%20need%20the%20right%20licenses.%20You%20can%20find%20this%20information%20in%20the%20following%20link%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fcompliance%2Fome-advanced-message-encryption%3Fview%3Do365-worldwide%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fcompliance%2Fome-advanced-message-encryption%3Fview%3Do365-worldwide%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20start%20our%20configuration%20in%20PowerShell.%20With%20the%20PowerShell%20we%20can%20create%20a%20new%20template%2C%20but%20only%20with%20the%20appropriate%20permissions.%20For%20example%2C%20to%20work%20with%20New-OMEConfiguration%20we%20need%20the%20necessary%20permission.%20I%20will%20show%20you%20later%20how%20to%20determine%20which%20permissions%20are%20needed%20to%20run%20a%20specific%20cmdlet.%20For%20this%20demo%20I%20used%20the%20%22Organization%20Management%22%20Role%20Group.%20This%20is%20certainly%20not%20ideal%20but%20absolutely%20fine%20for%20this%20demo.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20necessary%20permissions%20can%20be%20configured%20in%20the%20Microsoft%20365%20Defender%20portal.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fsecurity.microsoft.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsecurity.microsoft.com%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22_OME_Permissions.PNG%22%20style%3D%22width%3A%20577px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315241i10805B9883F1734E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22_OME_Permissions.PNG%22%20alt%3D%22_OME_Permissions.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20used%20the%20PowerShell%20ISE%20for%20this%20configuration.%20But%20you%20are%20also%20very%20welcome%20to%20use%20Visual%20Studio%20Code%2C%20just%20as%20you%20wish.%20%3CBR%20%2F%3EPlease%20start%20with%20the%20following%20steps%20to%20begin%20the%20deployment%20(the%20Hashtags%20are%20comments)%3A%20Note%3A%20In%20the%20following%20template%20I%20create%2C%20I%20make%20only%20a%20few%20adjustments.%20Of%20course%20you%20can%20also%20work%20with%20a%20logo%2C%20specify%20different%20text%2C%20etc.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23The%20first%20two%20lines%20have%20nothing%20to%20do%20with%20the%20configuration%2C%20but%20make%20some%20space%20below%20in%20the%20blue%20part%20of%20the%20ISE.%3CBR%20%2F%3E%3CSTRONG%3ESet-Location%20C%3A%5C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EClear-Host%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Install%20the%20module%3CBR%20%2F%3E%3CSTRONG%3EInstall-Module%20-Name%20ExchangeOnlineManagement%20-AllowClobber%20-Force%20-Verbose%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Sometimes%20the%20module%20must%20be%20imported%3CBR%20%2F%3E%3CSTRONG%3EImport-Module%20ExchangeOnlineManagement%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Connect%20to%20exchange%3CBR%20%2F%3E%3CSTRONG%3EConnect-ExchangeOnline%20-UserPrincipalName%20tom%40tomrocks.ch%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Did%20it%20work%3CBR%20%2F%3E%3CSTRONG%3EGet-EXOMailbox%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Get%20the%20OME%20branding%20template%3CBR%20%2F%3E%3CSTRONG%3E%24ome%20%3D%20Get-OMEConfiguration%20%7C%20fl%20*%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23All%20the%20settings%3CBR%20%2F%3E%3CSTRONG%3E%24ome%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Check%20the%20cmdlets%3CBR%20%2F%3E%3CSTRONG%3EGet-Command%20-Name%20*OME*%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Find%20the%20permissions%20required%20to%20run%20a%20cmdlet%3CBR%20%2F%3E%3CSTRONG%3EGet-ManagementRoleEntry%20-Identity%20*%5CNew-OMEConfiguration%20%7C%20ft%20-AutoSize%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Create%20an%20OME%20branding%20template%3CBR%20%2F%3E%3CSTRONG%3ENew-OMEConfiguration%20-Identity%20%22Outlook.com%22%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Background%20color%20(blue)%3CBR%20%2F%3E%3CSTRONG%3ESet-OMEConfiguration%20-Identity%20%22Outlook.com%22%20-BackgroundColor%20%22%230000ff%22%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Text%20next%20to%20the%20sender's%20name%20and%20email%20address%3CBR%20%2F%3E%3CSTRONG%3ESet-OMEConfiguration%20-Identity%20%22Outlook.com%22%20-IntroductionText%20%22has%20sent%20you%20a%20secure%20message.%22%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23To%20disable%20authentication%20with%20Microsoft%2C%20Google%2C%20or%20Yahoo%20identities%20for%20this%20custom%20template%3CBR%20%2F%3E%3CSTRONG%3ESet-OMEConfiguration%20-Identity%20%22Outlook.com%22%20-SocialIdSignIn%20%24false%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23To%20enable%20authentication%20with%20a%20one-time%20pass%20code%20for%20this%20custom%20template%3CBR%20%2F%3E%3CSTRONG%3ESet-OMEConfiguration%20-Identity%20%22Outlook.com%22%20-OTPEnabled%20%24true%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Optional%20set%20expiry%20days%3CBR%20%2F%3E%3CSTRONG%3ESet-OMEConfiguration%20-Identity%20%22Outlook.com%22%20-ExternalMailExpiryInDays%207%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23For%20more%20Infos%20check%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fcompliance%2Fadd-your-organization-brand-to-encrypted-messages%3Fview%3Do365-worldwide%23create-an-ome-branding-template-advanced-message-encryption%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fcompliance%2Fadd-your-organization-brand-to-encrypted-messages%3Fview%3Do365-worldwide%23create-an-ome-branding-template-advanced-message-encryption%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Check%20the%20details%3CBR%20%2F%3E%3CSTRONG%3E%24customome%20%3D%20Get-OMEConfiguration%20-Identity%20%22Outlook.com%22%20%7C%20fl%20*%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23All%20the%20settings%3CBR%20%2F%3E%3CSTRONG%3E%24customome%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20the%20template%20is%20created.%20Now%20we%20need%20to%20set%20up%20a%20new%20mail%20flow%20rule%20in%20Exchange%20Online.%20So%20that%20when%20an%20email%20is%20sent%20to%20a%20specific%20domain%20(outlook.com%20in%20my%20example)%2C%20the%20email%20is%20encrypted%20and%20our%20template%20is%20used.%20Please%20navigate%20to%20Exchange%20Online.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fadmin.exchange.microsoft.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fadmin.exchange.microsoft.com%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22_OME_Mail_Flow.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315242i684653ED0D2A440D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22_OME_Mail_Flow.PNG%22%20alt%3D%22_OME_Mail_Flow.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENow%20we%20test%20if%20it%20works.%20In%20Outlook%20we%20create%20an%20email%20and%20send%20it%20to%20an%20%40outlook.com%20email%20address.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22_OME_send_email.jpg%22%20style%3D%22width%3A%20606px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315243iB46900ADDE8EACCA%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22_OME_send_email.jpg%22%20alt%3D%22_OME_send_email.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EThe%20email%20has%20arrived%20and%20looks%20like%20this.%20As%20we%20can%20see%20our%20template%20has%20been%20used%2C%20among%20other%20things%20we%20can%20see%20the%20custom%20text%20we%20added%20with%20PowerShell.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Inked_OME_Email_LI.jpg%22%20style%3D%22width%3A%20738px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315244i6BE688CB6F63C1DC%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Inked_OME_Email_LI.jpg%22%20alt%3D%22Inked_OME_Email_LI.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20hope%20this%20article%20was%20helpful%20for%20you%3F%20Thank%20you%20for%20taking%20the%20time%20to%20read%20this%20article.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%20Tom%20Wechsler%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EP.S.%20All%20scripts%20(%23PowerShell%2C%20Azure%20CLI%2C%20%23Terraform%2C%20%23ARM)%20that%20I%20use%20can%20be%20found%20on%20github!%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ftomwechsler%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ftomwechsler%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2812341%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
MVP

 

Dear Microsoft 365 Friends,

 

This example is about using OME (Office Message Encryption) with a custom template. Whenever an email is sent to a specific domain (outlook.com in my example), the email should be encrypted and equipped with the custom template. The recipient can then decrypt the content with an OTP (one-time pass code).

To work with Advanced Office 365 Message Encryption you need the right licenses. You can find this information in the following link:
https://docs.microsoft.com/en-us/microsoft-365/compliance/ome-advanced-message-encryption?view=o365-...

 

We start our configuration in PowerShell. With the PowerShell we can create a new template, but only with the appropriate permissions. For example, to work with New-OMEConfiguration we need the necessary permission. I will show you later how to determine which permissions are needed to run a specific cmdlet. For this demo I used the "Organization Management" Role Group. This is certainly not ideal but absolutely fine for this demo.

 

The necessary permissions can be configured in the Microsoft 365 Defender portal.
https://security.microsoft.com/

_OME_Permissions.PNG

 

I used the PowerShell ISE for this configuration. But you are also very welcome to use Visual Studio Code, just as you wish.
Please start with the following steps to begin the deployment (the Hashtags are comments): Note: In the following template I create, I make only a few adjustments. Of course you can also work with a logo, specify different text, etc.

 

#The first two lines have nothing to do with the configuration, but make some space below in the blue part of the ISE.
Set-Location C:\
Clear-Host

 

#Install the module
Install-Module -Name ExchangeOnlineManagement -AllowClobber -Force -Verbose

 

#Sometimes the module must be imported
Import-Module ExchangeOnlineManagement

 

#Connect to exchange
Connect-ExchangeOnline -UserPrincipalName tom@tomrocks.ch

 

#Did it work
Get-EXOMailbox

 

#Get the OME branding template
$ome = Get-OMEConfiguration | fl *

 

#All the settings
$ome

 

#Check the cmdlets
Get-Command -Name *OME*

 

#Find the permissions required to run a cmdlet
Get-ManagementRoleEntry -Identity *\New-OMEConfiguration | ft -AutoSize

 

#Create an OME branding template
New-OMEConfiguration -Identity "Outlook.com"

 

#Background color (blue)
Set-OMEConfiguration -Identity "Outlook.com" -BackgroundColor "#0000ff"

 

#Text next to the sender's name and email address
Set-OMEConfiguration -Identity "Outlook.com" -IntroductionText "has sent you a secure message."

 

#To disable authentication with Microsoft, Google, or Yahoo identities for this custom template
Set-OMEConfiguration -Identity "Outlook.com" -SocialIdSignIn $false

 

#To enable authentication with a one-time pass code for this custom template
Set-OMEConfiguration -Identity "Outlook.com" -OTPEnabled $true

 

#Optional set expiry days
Set-OMEConfiguration -Identity "Outlook.com" -ExternalMailExpiryInDays 7

 

#For more Infos check:
https://docs.microsoft.com/en-us/microsoft-365/compliance/add-your-organization-brand-to-encrypted-m...

 

#Check the details
$customome = Get-OMEConfiguration -Identity "Outlook.com" | fl *

 

#All the settings
$customome

 

So the template is created. Now we need to set up a new mail flow rule in Exchange Online. So that when an email is sent to a specific domain (outlook.com in my example), the email is encrypted and our template is used. Please navigate to Exchange Online.
https://admin.exchange.microsoft.com/

 

_OME_Mail_Flow.PNG

 

Now we test if it works. In Outlook we create an email and send it to an @outlook.com email address.

_OME_send_email.jpg

 

The email has arrived and looks like this. As we can see our template has been used, among other things we can see the custom text we added with PowerShell.

Inked_OME_Email_LI.jpg

 

I hope this article was helpful for you? Thank you for taking the time to read this article.

 

Best regards, Tom Wechsler

 

P.S. All scripts (#PowerShell, Azure CLI, #Terraform, #ARM) that I use can be found on github! https://github.com/tomwechsler

 

0 Replies