| Enable Cloudmersive Email Protection for Exchange Online Members of Mail Enabled Security Group | 
		| 9/6/2025 - Cloudmersive Support | 
		| To enable Cloudmersive Email Protection for selected users, and to limit permissions to only those users, follow these steps.  The Cloudmersive Email Protection service will only have access to the emails of members of this security group. 
First, navigate to Entra ID,Manage,App Registrationsand click onNew Registration.Name the application CloudmersiveEmailProtectand under account type click on Single Tenant.  Click onRegister.Under this application, click on Certificates and SecretsandClient Secretsand thenNew Client Secret.  We recommend selecting a long expiration.  Be sure to note down the expiration date of the expiration as the key will need to be rotated, and the settings for Cloudmersive Email Protection will need to be updated prior to this date.Open a new browser tab and navigate to the Exchange Admin Center.  Click onGroups, and thenMail-enabled Security.  Click onAdd a group.  Under group type, selectMail-enabled security.  Name the groupCloudmersiveEmailProtect.  Assign at least one owner including yourself; note that an owner is not a member.  Add the appropriate members; these are the users who will have email protection enabled.  Note that you can also add Shared Mailboxes as members if needed.  Select an appropriate alias.  EnableRequire owner approval to join the group.  ClickCreate Group.At the top of the screen in Exchange Admin Centerclick onCloud Shell.  Execute this command: Connect-ExchangeOnline
 
Now execute this command: $g = Get-Group -Identity "CloudmersiveEmailProtect"
 
Now we will create the management scope that corresponds with this group: New-ManagementScope -Name "Scope-CloudmersiveEmailProtect" `
  -RecipientRestrictionFilter "((RecipientTypeDetails -eq 'UserMailbox') -or (RecipientTypeDetails -eq 'SharedMailbox')) -and (MemberOfGroup -eq '$($g.DistinguishedName)')"
 
Now run this command, but fill in the Client ID for the application we created previously: $appId = "YOUR-APPLICATION-CLIENT-ID-HERE"
 
In your other Entra IDtab go to the Entra ID home thenEnterprise ApplicationsthenCloudmersiveEmailProtectProdand copy theObject ID.  Now go back to yourExchange Admin Center,Cloud Shelltab, and paste in the following command filling in theObject ID: $spObjectId = "YOUR-OBJECT-ID-HERE"
 
Now execute this command: New-ServicePrincipal -AppId $appId -ObjectId $spObjectId -DisplayName "CloudmersiveEmailProtectPrincipal"
 
Now execute this command to grant mail read and write permissions to the application, but only to this user group scope: New-ManagementRoleAssignment   -Name "AppMailReadWrite-AllowedGroup"   -App $spObjectId   -Role "Application Mail.ReadWrite"   -CustomResourceScope "Scope-CloudmersiveEmailProtect"
 
Now execute this command to grant mail settings read and write (used to create and manage mail categories) to the application, but only to this user group scope: New-ManagementRoleAssignment   -Name "AppMailSettingsReadWrite-AllowedGroup"   -App $spObjectId   -Role "Application MailboxSettings.ReadWrite"   -CustomResourceScope "Scope-CloudmersiveEmailProtect"
 |