Exchange Online app registration (group email addresses)
By default, a group the Entra sync creates has an email address ending in …@yourtenant.onmicrosoft.com. This guide sets things up so groups get addresses on your own domain instead — for example [email protected].
It has two halves. In Microsoft, whoever manages your Microsoft 365 registers a small app that is allowed to set group email addresses in Exchange Online. In Realsmart, you paste in two details about that app and upload its certificate. It's a one-off job, plus renewing the certificate before it expires.
This app is separate from the Realsmart Entra Sync app you set up for Microsoft Entra settings. Keep them separate.
Before you start
- The Entra sync must already be connected and working for the school — see Microsoft Entra settings.
- The school's User principal domain must be your own domain. Group addresses use the same domain as people's sign-in names, set under Entra sync → Settings → Connection → User principal domain. If it still ends
.onmicrosoft.com, change it first; until then this setup does nothing (the settings page tells you so). - That domain must be an accepted domain in Exchange Online. Verifying it in Entra is not enough on its own. In the Exchange admin center, go to Mail flow → Accepted domains and check it's listed. For a trust using a subdomain per school, each subdomain needs to be there.
- You need to manage the Microsoft 365 tenant — create app registrations, grant admin consent and assign admin roles — or ask whoever does to follow Steps 1 to 4.
- A certificate is required. A client secret will not work. Exchange Online only lets apps sign in with a certificate. Step 4 shows how to make one.
Steps
Step 1: Register the app
In the Microsoft Entra admin center, go to Applications → App registrations → New registration. Name it realsmart-exo-app, choose Accounts in this organizational directory only (single tenant), leave the redirect URI blank, and select Register.
On the app's Overview page, copy the Application (client) ID. You'll paste it into Realsmart in Step 5.
Step 2: Add the Exchange Online permission
Still in the app, open API permissions in the left menu.
- Select + Add a permission.
- Select the APIs my organization uses tab. This permission is not on the Microsoft Graph tab.
- Search for Office 365 Exchange Online and select it.
- Select Application permissions.
- Tick Exchange.ManageAsApp and select Add permissions.
Then select Grant admin consent for your organisation, so the permission is actually switched on and not just requested.
Step 3: Assign the Exchange Recipient Administrator role
The permission lets the app sign in to Exchange Online; this role lets it change group addresses once it has.
- In the Microsoft Entra admin center, go to Identity → Roles & admins → Roles & admins.
- Search for Exchange Recipient Administrator and select the role's name.
- Select Add assignments.
- Search for realsmart-exo-app, select it, and select Add.
Step 4: Create a certificate and add it to the app
A certificate comes as a pair of files:
- a .cer file — the public half, which you add to the app in Azure;
- a .pfx file — the private half, protected by a password, which you upload to Realsmart in Step 5.
A self-signed certificate is fine. On a Windows computer, open PowerShell and run the following. It asks you to choose a password for the .pfx and saves both files in the folder PowerShell is open in.
$cert = New-SelfSignedCertificate -Subject "CN=realsmart-exo-app" `
-CertStoreLocation "Cert:\CurrentUser\My" `
-KeyExportPolicy Exportable -KeySpec KeyExchange `
-KeyAlgorithm RSA -KeyLength 2048 -HashAlgorithm SHA256 `
-NotAfter (Get-Date).AddYears(2)
Export-Certificate -Cert $cert -FilePath ".\realsmart-exo-app.cer"
$password = Read-Host -AsSecureString -Prompt "Choose a password for the .pfx file"
Export-PfxCertificate -Cert $cert -FilePath ".\realsmart-exo-app.pfx" `
-Password $password -CryptoAlgorithmOption AES256_SHA256
$cert.Thumbprint
If PowerShell says it can't find the -CryptoAlgorithmOption parameter (older versions of Windows), run the Export-PfxCertificate line again without it.
Then, back in the app in the Microsoft Entra admin center, go to Certificates & secrets → Certificates → Upload certificate, choose realsmart-exo-app.cer, and select Add. Azure shows the certificate's Thumbprint — the same value PowerShell printed. You'll check it against Realsmart in the next step.
Do not create a client secret for this app; Exchange Online can't use one.
Step 5: Add the app and certificate in Realsmart
With the school selected, go to Entra sync → Settings and open the Group email addresses section.
- Switch on Set group email addresses on our domain.
- Exchange Online app ID — paste the Application (client) ID from Step 1. It looks like
00000000-0000-0000-0000-000000000000. - Tenant domain — your tenant's original Microsoft domain, ending
.onmicrosoft.com(for exampleyourschool.onmicrosoft.com). Find it in the Microsoft Entra admin center under Settings → Domain names. Don't put your own domain here. - Select Save settings.
- Under Certificate and progress, choose realsmart-exo-app.pfx next to Certificate file (.pfx), type its password under Certificate password, and select Upload certificate. The upload saves straight away; you don't need to select Save settings for it. It's checked first: if the password is wrong, the file is the .cer instead of the .pfx, or the certificate has already expired, you're told why and nothing is saved (see If the upload is refused).
- Check the Thumbprint shown matches the one in Azure (Certificates & secrets). If it doesn't, the certificate in Azure and the one uploaded here are different — upload the matching pair.
Keep the private key private. The .pfx file and its password only ever go into this upload. Never email them to anyone — including Realsmart — or leave them in a shared folder. Once uploaded, you can delete the .pfx from your computer; if you need to replace the certificate later, make a new one.
Running a trust on one Microsoft 365 tenant? You only need one Exchange Online app. In MAT overview, Entra settings → Group email addresses lets you tick the settings and Exchange Online certificate once and apply them to every school you choose — see Apply sync settings across the trust.
What happens next
- Straight after uploading, the page shows Waiting for the next sync to pick up the new certificate. Once the sync has picked it up, this changes to Ready for the sync.
- Addresses are set by the daily Entra sync (every morning at 06:00, Sunday to Friday), for new groups and for groups that already exist. Microsoft copies new groups from Entra to Exchange Online in the background, so a group can take a few days to get its address. That's normal.
- Each group keeps its
…onmicrosoft.comaddress as an extra address, so nothing sent to the old address is lost. - For a group that also has a Teams or SharePoint site, the Microsoft admin portal may still show the
onmicrosoft.comaddress as primary even though mail uses your domain. That's a Microsoft display quirk, not a fault.
Seeing progress and problems
- Entra sync → Settings → Group email addresses shows how many of the school's groups have their address set, how many are waiting, and how many couldn't be set.
- Entra sync → Issues explains anything that went wrong and what to do — for example groups that couldn't be given their address after several tries, a certificate that is about to expire, or a missing app ID. See Entra sync issues.
If groups couldn't be given their address, the usual causes are:
- the domain isn't an accepted domain in the Exchange admin center;
- the app is missing Exchange.ManageAsApp with admin consent (Step 2) or the Exchange Recipient Administrator role (Step 3);
- the certificate was replaced in Azure but the new .pfx wasn't uploaded to Realsmart — compare the thumbprints.
Once the cause is fixed, the sync tries those groups again.
Two messages can appear on the Group email addresses section itself:
- Set your own domain first — the school's User principal domain is empty or still ends
.onmicrosoft.com, so switching this on does nothing. Set it to your own domain under Connection first. - Not ready yet — group email addresses are switched on, but the app ID, the tenant domain or the certificate (it names whichever are missing) hasn't been added. Groups keep their
…onmicrosoft.comaddress until it is.
If the upload is refused
The certificate is checked before anything is saved, and nothing changes if it's refused. Exactly what you might see, and what to do:
| Message | What to do |
|---|---|
| Choose the .pfx file to upload. / The file didn't upload. Try again. | Pick the file again. |
| Enter the password you set when you exported the .pfx file. | Type the password. |
| This is the public certificate (.cer), which goes into Azure. Here, upload the .pfx file that includes the private key. | You chose the .cer. Upload the .pfx from Step 4; the .cer is for Azure. |
| Upload a .pfx (or .p12) file. / This file is not a .pfx. Upload the .pfx file you exported with the private key. / The file is empty… / The file is too large to be a certificate… | Choose the .pfx file you exported with the private key. |
| The password is not right for this .pfx file. Check it and try again. | Use the password you chose when you exported it. |
| This .pfx file uses an old encryption format that cannot be read. Export it again choosing AES256-SHA256 encryption… | Run the Export-PfxCertificate line in Step 4 with -CryptoAlgorithmOption AES256_SHA256, then upload the new file. |
| The .pfx file does not contain the private key. Export it again with the private key included. | Export from the certificate in PowerShell as shown in Step 4, not from a copy that has only the public half. |
| The private key in the .pfx file does not belong to its certificate. Export the .pfx again from the same certificate you uploaded to Azure. | Make the .pfx and .cer from the same certificate. |
| This certificate expired on … | Create a new certificate, add its .cer in Azure, then upload the new .pfx. |
If Save settings refuses the app ID or tenant domain: the Exchange Online app ID must look like 00000000-0000-0000-0000-000000000000 (the Application (client) ID from the app's Overview page), and the Tenant domain must be your tenant's original domain ending .onmicrosoft.com, not your own domain.
Renewing the certificate
The certificate stops working on its expiry date, and group addresses stop being set. The settings page shows the expiry date and turns amber in the last 30 days (red once it has expired), and Entra sync → Issues warns you too.
To renew, repeat Step 4 to make a new certificate and add its .cer in Azure, then upload the new .pfx in Step 5 — Replace certificate. Add the new one in Azure before removing the old one there, so there's no gap. Check the thumbprint matches, then remove the old certificate from the app in Azure.
Switching it off
Switch off Set group email addresses on our domain and save. Groups that already have an address on your domain keep it. Remove certificate deletes the stored certificate from Realsmart; also remove it from the app in Azure if you no longer need it.
Related
Did this work for you?
If a step looked different on your site, tell us and we'll update the screenshots.
Thanks for your feedback.