Prepare a Microsoft 365 account for TEDI
This article is for the client's Microsoft 365 or Microsoft Entra admin. When you finish, hand the values in Step 7 (and, for company mailboxes, What you hand back) to the TEDI operator, who completes Configure Microsoft 365 in TEDI.
TEDI uses up to two app registrations in your tenant. Both are yours: your tenant, your registrations, your consent. Nothing here gives Robonauts access to your systems.
| App registration | What it is for | How TEDI signs in | Needed when |
|---|---|---|---|
| Signed-in person (Steps 1 to 7) | Teams channel chat and replies, Outlook chat and replies, mail sent as the TEDI user, Outlook calendar sync | As the TEDI user, with a device code and delegated Microsoft Graph permissions | You want Teams or Outlook chat with TEDI |
| TEDI as an app (below) | Document Intelligence reading company mailboxes (for example an AP inbox), and customer and vendor statements emailed from a company mailbox (for example ar@ or ap@) | As the app itself, unattended, with a certificate TEDI generates, limited by Exchange Online to the mailboxes you list | You want mailbox document intake or statement email |
What you'll set up and hand off
- Only for Teams and Outlook chat: a licensed work or school user that TEDI signs in as (for example
tedi@yourcompany.com), in a Team and channel (Steps 1 to 3). - Both app registrations, their permissions and admin consent. Set up in Microsoft 365 in TEDI does all of this in one admin sign-in and fills in every ID (The quick way). Steps 4 to 6 and the setup script below are the by-hand alternative.
- A handoff to the TEDI operator.
Who does this and needed roles
- User and license: User Administrator and License Administrator, or equivalent.
- Signed-in person app registration and admin consent: Cloud Application Administrator. Microsoft names it as the least-privileged role for granting tenant-wide admin consent to delegated Microsoft Graph permissions ("sign in as at least a Cloud Application Administrator"), and it can also register apps. Source: Grant tenant-wide admin consent to an application.
- Set up in Microsoft 365, or the setup script: a Global Administrator, or an Application Administrator. When company mailboxes are ticked, an Application Administrator must also be an Exchange Administrator, because the setup assigns Exchange Online application roles, which a Cloud Application Administrator alone cannot do.
The quick way: Set up in Microsoft 365
TEDI creates both app registrations for you, with the right permissions and admin consent, fills in every ID and tests each mailbox. Nobody adds API permissions or copies IDs by hand. Do this at the TEDI PC, in the TEDI app, with the TEDI operator. Allow about 15 minutes. On a tenant that has never used Exchange customization, allow about an hour of waiting in the middle.
Before you start
- Your admin account (see Who does this and needed roles). Every Microsoft sign-in below uses it.
- For Teams and Outlook chat: the TEDI user from Steps 1 to 3, and its password.
Steps
- In TEDI, open Settings > Microsoft 365 > TEDI as an app (mailbox intake and statements).
- Under What TEDI may do, tick what the client uses:
- Chat in Teams and Outlook as a person
- Read company mailboxes for Document Intelligence
- Send customer and vendor statements as a company mailbox
- For mailboxes: under Mailboxes TEDI may use, click Add mailbox for each one (for example
ap@yourcompany.com) and tick Read, Send or both. The mailbox, and any folder TEDI reads, must already exist. - If your tenant already has an app registration named
TEDI(for example your Teams/Outlook sign-in app), set Name in Entra to something unique, such asTEDI Mailboxes. Then click Save and generate certificate (Save on later runs). TEDI creates its certificate; you can ignore the.cerfile it downloads. - Under Set it up in your Microsoft 365, type your admin email in Microsoft 365 admin email and click Set up in Microsoft 365.
- A PowerShell window opens. Leave it open. It shows an address and a code. Open the address in any browser (on this PC or your phone), enter the code, and sign in with your admin email. This works whoever is signed in to Windows.
- If Microsoft asks you to sign in again (for Exchange), use the same admin email:
- If a different account is offered, choose Use another account.
- If Windows asks to sign you in to all apps and websites, choose No, sign in to this app only. If it shows Allow my organization to manage my device, clear it.
- If Microsoft asks you to approve permissions, tick Consent on behalf of your organization and accept.
- When the window says Finished, TEDI shows Set up in Microsoft 365: finished, with the IDs it saved and a test of each mailbox. A new app's mailbox test can take Microsoft up to 2 hours to pass, even though the setup is correct. Until then TEDI cannot read or send from those mailboxes; emails wait in the inbox and nothing is lost. Click Test read again later. Run the setup early in an install so the wait overlaps other work.
- If you ticked Teams and Outlook, do the One step left for Teams and Outlook that TEDI shows in Signed-in person (Teams and Outlook). For a new sign-in app: click Test connection, sign in as the TEDI user (not the admin), then click Refresh permissions. For the sign-in app TEDI already used: just click Refresh permissions; the client ID is unchanged, so there is no new sign-in.
If it stops: TEDI shows Failed at and the step. Fix the cause in the table below, then click Set up in Microsoft 365 again. It carries on from what is already done.
| What TEDI shows | What to do |
|---|---|
| Failed at Turning on Exchange customization | Normal on a tenant's first run. Wait about an hour, then click Set up in Microsoft 365 again. |
Failed at Checking the signed-in account: Microsoft signed in as ..., not ... or ... which is not a Global Administrator ... | Someone other than the admin signed in on the code page, or in a Windows sign-in. Nothing was changed. Run it again and sign in with the admin email. |
Exchange refused to give the app ... delegating role assignment | Exchange has not finished preparing the tenant. In our testing this cleared on its own a little over an hour after customization was turned on. Wait, then run it again. |
| The setup window was closed before it finished | Click Set up in Microsoft 365 again. |
An app registration named 'TEDI' already exists and is ... a Teams/Outlook sign-in app ... | Your tenant already has an app with that name, usually the Teams/Outlook sign-in app set up earlier. Nothing was changed. Change Name in Entra (for example TEDI mailboxes), click Save, and run it again. |
Run it again whenever the mailbox list changes or TEDI generates a new certificate. Away from the TEDI PC? Use Run the setup script instead.
What TEDI needs from Microsoft 365
TEDI signs in as one user through Microsoft Graph with a device code and uses that user's Teams membership and Exchange Online mailbox. No special SKU is needed.
- A work or school account in your tenant. Personal accounts (
@outlook.com,@hotmail.com,@live.com) are not supported. - One license seat that includes both Microsoft Teams and Exchange Online. Microsoft 365 Business Basic (with Teams) is the usual lowest-cost choice. Business Standard, Business Premium, E3, and E5 (with Teams) also work. E5 is not required: TEDI uses standard delegated Graph channel APIs, not the metered Teams export APIs. A spare seat is fine.
- Membership in the Team TEDI will watch. A license does not add the user to a Team.
Poor fits: Apps-only licenses (no mailbox or Teams), a shared mailbox (not supported; TEDI always reads and sends as the signed-in user's own mailbox), a guest (B2B) user, or a staff member's everyday mailbox (TEDI's replies collide with that person's mail).
Step 1: Choose the identity
- Pick a dedicated UPN and display name, for example
tedi@yourcompany.comand TEDI. If the operator plans to give the assistant a personal name in TEDI (the TEDI username, set in TEDI under Settings > Profile, defaultTEDI), you can match it, for examplecasey@yourcompany.comand Casey. - Decide which Team and channel the account will join.
Step 2: Assign a license and create the user
If a dedicated user with Teams and a mailbox already exists, confirm its license and go to Step 3.
- Open the Microsoft 365 admin center.
- Go to Billing > Licenses. Confirm a product with Exchange Online and Microsoft Teams has an unassigned seat. If not, buy one or free a seat.
- Go to Users > Active users > Add a user. In the Simplified view, select Add user instead.
- Enter the Display name and Username from Step 1. TEDI's channel posts show this display name.
- Set a password and record it securely.
- Under Assign product licenses, assign the Teams and Exchange Online license. Leave optional add-ons off unless your policy requires them.
- Finish the wizard and wait a few minutes for the mailbox and Teams to provision.


Expected outcome: The user appears under Active users with a licensed mailbox.
Step 3: Verify mailbox, Teams, MFA, and the Team and channel
TEDI does not install a Teams app or create a Team or channel. Teams meetings started with Meet Now are joined from a Meet Now already posted in the watched channel; TEDI never creates them.
- Sign in as the TEDI user at outlook.office.com. Confirm the Inbox opens.
- If your tenant enforces MFA, complete enrollment for this account now so the operator's first sign-in does not stall.
- Sign in to teams.microsoft.com as the same user.
- Open or create the Team TEDI will watch, for example TEDI Assistant.
- Open or create a standard channel where people will post for TEDI, for example Ask TEDI. Private and shared channels are not verified for TEDI polling and replies.
- Confirm the TEDI user is a member of that Team.

Expected outcome: The account opens Outlook and sees TEDI Assistant > Ask TEDI. The operator picks them from a list in TEDI, so nobody copies Graph IDs.
Step 4: Register the Entra app as a public client
Skip Steps 4 to 6 if you used Set up in Microsoft 365 with Chat in Teams and Outlook as a person ticked. It already did them.
TEDI signs in with the device code flow, which requires a public client.
- Open the Microsoft Entra admin center.
- Go to Entra ID > App registrations > New registration.
- Set:
- Name: for example
TEDI Graph. - Supported account types: Single tenant only (Microsoft's recommendation for most apps) or Multiple Entra ID tenants, per your policy. Older portal versions label these Accounts in this organizational directory only and Accounts in any organizational directory. Record which one you chose.
- Redirect URI: if the form shows it, leave it blank.
- Name: for example
- Select Register.
- On Overview, copy the Application (client) ID and Directory (tenant) ID.
- Open Authentication and select the Settings tab. Turn on Allow public client flows (the default is Disabled) and save the change.
- Do not add anything under Certificates & secrets.

Step 5: Add delegated Microsoft Graph permissions
- In the app, open API permissions > Add a permission > Microsoft Graph > Delegated permissions. Do not use Application permissions.
- Add all 13 permissions below. TEDI requests all 13 at sign-in and checks every one. The 7 core permissions are required for sign-in to pass. Without an optional group, text inbound still works but that feature does not.
| Permission | What TEDI uses it for | Admin consent required (per Microsoft) | Core or optional (group) |
|---|---|---|---|
User.Read | Signed-in identity | No | Core |
Team.ReadBasic.All | List teams | No | Core |
Channel.ReadBasic.All | List channels | No | Core |
ChannelMessage.Read.All | Poll channel messages | Yes | Core |
ChannelMessage.Send | Post channel replies and the start-gate alert thread | No | Core |
Mail.Read | Poll the inbox | No | Core |
Mail.Send | Send email replies and the start-gate alert emails | No | Core |
ChannelMember.Read.All | Look up channel members' email addresses (channel roster emails) | Yes | Optional (proof) |
User.ReadBasic.All | Resolve the asker's email address | No | Optional (proof) |
Calendars.Read | Read meeting details, including calendar events and channel Meet Now join URLs | No | Optional (calendar) |
Calendars.ReadWrite | Outlook calendar sync: push Schedules, Monitors, and other due items to a dedicated Outlook calendar named TEDI | No | Optional (calendar) |
Files.Read.All | Download files shared from SharePoint or OneDrive that are attached to Teams channel messages | No | Optional (files) |
Sites.Read.All | Download files attached to Teams channel messages when they are stored in SharePoint | No | Optional (files) |
Consent values are from the delegated column of the Microsoft Graph permissions reference.

Step 6: Grant admin consent
Admin consent is always required for TEDI, because ChannelMessage.Read.All and ChannelMember.Read.All need it.
- On API permissions, select Grant admin consent and confirm.
- Confirm every row shows Granted in the Status column.
If you add or change a permission later, grant consent again and tell the operator so they can refresh permissions in TEDI.
Step 7: Hand off to the TEDI operator
Send these values through a secure channel. Send the password separately from the UPN. If you used Set up in Microsoft 365, TEDI already has the Client ID and Tenant ID.
| Item | Value |
|---|---|
| TEDI user UPN | For example tedi@yourcompany.com |
| First sign-in and MFA | Confirmation that first sign-in and MFA enrollment are done, and how the operator gets the password |
| Client ID | Application (client) ID from Step 4 |
| Tenant ID and supported account type | Directory (tenant) ID from Step 4, and whether the app is single tenant or multitenant. The TEDI field is optional, and blank uses the organizations authority. A single-tenant app, the usual kind, requires the tenant ID in practice, or sign-in fails with AADSTS50194. |
| Team and channel | For example TEDI Assistant > Ask TEDI |
| TEDI users | The people who should be TEDI super users (the All Skills group) and any individual users, so the operator can set up Groups in TEDI |
TEDI as an app: company mailboxes and statement email
Skip this section if the client does not use Document Intelligence mailbox intake or statement email from a company mailbox. Steps 1 to 7 are all that Teams and Outlook chat need.
What it is for
- Company mailbox document intake. Document Intelligence reads the company mailboxes you list (for example an AP inbox), takes the documents, and files each message after handling it.
- Statement email. TEDI sends customer and vendor statements as a company mailbox you list (for example
ar@yourcompany.com), and the copy stays in that mailbox's Sent Items.
Both run unattended in the TEDI service, so they cannot depend on a person's sign-in. That is why this is a second app registration, separate from the signed-in person in Steps 4 to 6.
How it is set up
- A certificate-based app registration. TEDI generates a certificate (valid 2 years) when the operator first saves the connection. The private key stays on the TEDI PC. Only the public
.cergoes into your tenant, embedded in the setup script. There is no client secret. - Exchange RBAC for Applications, not a tenant-wide grant. The script does not add mail permissions to the app in Entra. It gives the app the Exchange Online application roles
Application Mail.ReadWrite(for the mailboxes marked Read) andApplication Mail.Send(for the mailboxes marked Send), each limited by a management scope that matches exactly the listed addresses. The app cannot open any other mailbox. - One setup, written by TEDI. The operator fills in Settings > Microsoft 365 > TEDI as an app (mailbox intake and statements): ticks what TEDI may do under What TEDI may do, lists the mailboxes under Mailboxes TEDI may use with Read and Send, and clicks Save and generate certificate. Then either Set up in Microsoft 365 runs it on the TEDI PC (The quick way), or Download setup script (or Copy script) gives you the same script to run yourself. It is written from what is saved and contains no secrets.
Run the setup script
Use this only when you cannot use Set up in Microsoft 365 at the TEDI PC. It is the same script; the difference is that you hand the IDs back yourself.
Before you start
- Your admin account (see Who does this and needed roles). Every sign-in below uses it.
- Get
TEDI Microsoft 365 setup.ps1from the TEDI operator. Download setup script in TEDI saves it to the Downloads folder. Read it before you run it. It contains no secrets.
Steps
Run every command in the same PowerShell window. Paste one command at a time and press Enter.
-
Open Windows PowerShell from the Start menu. You do not need Run as administrator.
-
Allow scripts in this window only. Windows blocks scripts by default; this setting ends when you close the window.
Set-ExecutionPolicy -Scope Process Bypass -Force -
Run the script with your admin email. The first time on a PC it installs Microsoft's PowerShell modules for your Windows account, which takes a few minutes.
& "$HOME\Downloads\TEDI Microsoft 365 setup.ps1" -AdminUpn admin@yourcompany.com -
The window shows an address and a code. Open the address in any browser, enter the code, and sign in with that admin account. If you are asked to sign in again (for Exchange), use the same account: choose Use another account if a different account is offered, No, sign in to this app only if Windows asks about all apps and websites, and clear Allow my organization to manage my device if it is shown.
-
Watch the last line:
- Green Finished: it worked. Hand back the IDs printed above it (see What you hand back).
- Red Failed at names the step. Find it in Troubleshooting the setup script, fix it, and repeat steps 2 and 3 in a new window. It carries on from what is already done.
What the script does: it creates the app registration (single tenant, no public client flows) under the name the operator set in Name in Entra (default TEDI), or finds it by that name, and uploads TEDI's certificate if it is not already there. Then it sets up Exchange Online: turns on customization if needed, registers the app, creates the mailbox scope, assigns the roles, and checks each listed mailbox. If Chat in Teams and Outlook as a person is ticked, it also creates the signed-in person app of Steps 4 to 6 (public client flows on, the delegated permissions, tenant-wide admin consent). If TEDI already has a signed-in person app, it adds TEDI's permissions and consent to that app instead, keeping its client ID.
Run it again whenever the operator changes the mailbox list or generates a new certificate.
The mailbox part has no screen in the Microsoft 365 or Entra admin centers: Microsoft only offers it in Exchange Online PowerShell. If you prefer to do the Entra part by hand, the same TEDI tab has Prefer the portal? The same setup as steps, with the Exchange PowerShell lines filled in with the real addresses.
Troubleshooting the setup script
| What you see | What it means | What to do |
|---|---|---|
... cannot be loaded because running scripts is disabled on this system | Windows blocks scripts by default. | Run step 2 in the same window, then step 3 again. |
Failed at Checking the signed-in account: Microsoft signed in as ..., not ... or ... which is not a Global Administrator ... | Someone other than the admin signed in on the code page, or in a Windows sign-in. Nothing was changed. | Open a new window, repeat steps 2 and 3, and sign in with the admin account. |
Failed at Setting up the app registration: An app registration named '...' already exists and is ... a Teams/Outlook sign-in app ... | An app with the name in Name in Entra already exists and is a sign-in app, not TEDI as an app. Nothing was changed. | Ask the operator to change Name in Entra (for example TEDI mailboxes) and click Save, then download the script again and rerun it. |
Failed at Setting up the app registration: TEDI as an app has the Application (client) ID ..., but this tenant has no app registration with that client ID | The app TEDI saved was deleted in Entra, or the ID belongs to another tenant. Nothing was changed. | Clear Application (client) ID under TEDI as an app, click Save, and run it again. It creates a new app. |
Yellow Exchange customization is now turned on ..., then Failed at Turning on Exchange customization | Normal on a tenant's first run. Exchange needs time to prepare. | Wait about an hour, then repeat steps 2 and 3 in a new window. |
Exchange refused to give the app 'Application Mail.ReadWrite': ... You must be assigned a delegating role assignment ... | Exchange has not finished applying the customization (or a new admin role membership) yet. In our testing this cleared on its own a little over an hour after customization was turned on. | Wait, then repeat steps 2 and 3 in a new window. If it still fails after two hours, run Get-RoleGroupMember 'Organization Management' to confirm your account (or its admin group) is listed. |
In TEDI, Test read says The app is not allowed to use this mailbox yet (or Send test email says ... not allowed to send as ... yet) | Microsoft has not applied the new access yet (up to 2 hours), or the mailbox is not in the setup's list. | Click Test read again later. If it still fails after 2 hours, or the operator added the mailbox after the setup ran, run the setup again. |
What you hand back
With Set up in Microsoft 365, TEDI fills these in itself. After running the script yourself, hand back:
| Item | Where it goes in TEDI |
|---|---|
| Directory (tenant) ID | TEDI as an app > Directory (tenant) ID |
| The app's Application (client) ID | TEDI as an app > Application (client) ID |
| The sign-in app's client id (only if the script created it) | Signed-in person (Teams and Outlook) > Client id, with the same tenant ID in Tenant id (optional) |
The operator then clicks Test sign-in, Test read on each Read mailbox, and Send test email on each Send mailbox (a real email from the mailbox to itself). TEDI shows the certificate's expiry date and counts down its last 30 days. Before it expires, the operator clicks Generate a new certificate, and you run the script again.
Checklist
- Teams and Outlook only: work or school user created with a Teams and Exchange Online license, Outlook opens, MFA enrolled if required, member of the Team and channel
- Set up in Microsoft 365 shows Set up in Microsoft 365: finished (or the setup script ends with green Finished and the IDs are handed back), signed in as your admin account
- Teams and Outlook only: Test connection signed in as the TEDI user, then Refresh permissions, every row green
- Company mailboxes only: Test read passes on each Read mailbox and Send test email on each Send mailbox (allow up to 2 hours)
- Remaining handoff values sent to the TEDI operator
Common mistakes
- Public client flows left off. Device code sign-in fails until Allow public client flows is turned on (Authentication, Settings tab).
- Creating or pasting a client secret. Neither app uses one. The signed-in person app is a public client, and TEDI as an app uses TEDI's certificate.
- Application permissions on the signed-in person app. That app signs in as a user and uses delegated permissions only.
- Adding Mail.ReadWrite or Mail.Send as Entra application permissions on TEDI as an app. That would reach every mailbox in the tenant. The setup script uses Exchange RBAC for Applications instead, limited to the listed mailboxes.
- Running the setup script as a Cloud Application Administrator. It needs a Global Administrator, or an Application Administrator who is also an Exchange Administrator.
- Signing in with the account already on the PC. On the code page, and in any Windows sign-in, use the admin account, not whoever is signed in to the computer. If your organization blocks sign-in with a code, the setup says so and opens the normal Microsoft sign-in instead; choose Use another account there.
- Giving up after the first run on a new tenant. If the setup stops at Turning on Exchange customization, that is expected. Wait about an hour and run it again.
- Reusing the name of an app you already have. If your Teams/Outlook sign-in app is named
TEDI, set Name in Entra to something else, for exampleTEDI mailboxes, before the first run. The setup stops rather than take over a sign-in app. - Signing in to Test connection as the admin. The admin signs in only in the PowerShell window. Test connection in Signed-in person is the TEDI user's sign-in.
- Skipping admin consent.
ChannelMessage.Read.AllandChannelMember.Read.Allnever work without it. - Single-tenant app handed off without the tenant ID. TEDI then uses the
organizationsauthority, and sign-in fails with AADSTS50194. - Wrong license. Apps-only, mailbox-only, or Teams-only plans leave out a service TEDI needs.
- Skipping Team membership. A license does not add the user to the Team.
Next steps
- Configure Microsoft 365 in TEDI: the operator enters the handoff values.
- Install and set up TEDI: the full setup order.