> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neoagent.io/llms.txt
> Use this file to discover all available pages before exploring further.

# M365 User Offboarding

> Offboard a departing user across Microsoft 365, Exchange, Active Directory and your PSA, with technician approval on every change

The agent works one termination ticket from start to finish. It checks that the person who asked may request a termination, reads your termination SOP, and then works through the user's mailbox, sign-in, licenses, groups and PSA contact. Each change to the user, the mailbox or a group waits for a technician to approve it. It is the reverse of [M365 User Onboarding](https://docs.neoagent.io/recipes/m365-user-onboarding.md), and for hybrid clients it uses the same company and RMM setup as [Hybrid AD User Onboarding](https://docs.neoagent.io/recipes/hybrid-ad-user-onboarding.md).

## Pick the template for your PSA

Two templates carry the name **M365 User Offboarding**. They have the same instructions, tools and Microsoft 365, Exchange and Active Directory permissions. Only the PSA settings differ. The template picker shows only the one that matches your PSA.

| Your PSA | Template | PSA settings as shipped |
| - | - | - |
| Autotask or Halo | [M365 User Offboarding (Autotask, Halo)](https://dashboard.neoagent.io/agents/create?templateId=59) | **Tickets** at **Write** with **Merge** off. **Contacts** and **Ticket Notes (Client-Facing)** (on Halo, **Client-Facing Actions**) at **Write** with **Approval** on. |
| ConnectWise or Syncro | [M365 User Offboarding (ConnectWise, Syncro)](https://dashboard.neoagent.io/agents/create?templateId=90) | ConnectWise: as Autotask and Halo, with **Bundle** off too. Syncro: **Tickets** and **Work Notes** at **Write** with **Approval** off, **Contacts** at **Read**, **Client-Facing Notes** at **None**. |

Neither template supports ServiceNow, Accelo or Zendesk.

> [!WARNING]
>
> On Syncro, the template cannot deactivate the contact or send the completion reply as shipped, because **Contacts** is at **Read** and **Client-Facing Notes** is at **None**. Set both to **Write** on **Tools & Settings**, under **PSA**, or delete steps 8 and 10 from the instructions.

## What the agent does

The steps come from the template's **Custom Instructions**. Each change uses a permission group on the **Tools & Settings** tab.

| Step | What the agent does | Permission group or tool |
| - | - | - |
| 1 | Checks that the requester has an Admin, HR, Director, VIP, Payroll Coordinator or C-level title or type. It continues only for an authorized requester. Otherwise the instructions tell it to ask Admins and HR to confirm. | **Find PSA Contacts** |
| 2 | Searches your documentation for "User Termination" and follows that SOP | **Find Documentation** |
| 3 | Converts the user's mailbox to a shared mailbox | Exchange **Mailboxes** |
| 4 | Adds the forwarding and delegated access the ticket asks for | Exchange **Mailboxes** and **Mailbox Permissions** |
| 5 | Blocks sign-in and resets the password | Microsoft 365 **User Management**, Active Directory **User Management** for hybrid clients, **Generate Password** |
| 6 | Removes the user's licenses, then lowers the seat count on your marketplace | Microsoft 365 **Licensing**, **List License Subscriptions**, **Change License Seats** |
| 7 | Removes the user from all groups and lists them in the internal note | Microsoft 365 **Groups**, Active Directory **Groups** |
| 8 | Deactivates the PSA contact and sets its Title to `Terminated %MM/DD/YY% - %Ticket ID%` | PSA **Contacts** |
| 9 | Adds the user's full name to the ticket title | PSA **Tickets** |
| 10 | Replies to the ticket's contact that the request is done | PSA client-facing notes |
| 11 | Adds an internal note for the audit trail | PSA internal notes |

For a hybrid client, Neo makes directory changes in on-prem Active Directory and starts an Entra Connect sync to carry them to Microsoft 365. Set the client up as in [Hybrid AD User Onboarding](https://docs.neoagent.io/recipes/hybrid-ad-user-onboarding.md) steps 1 and 2.

The template also turns on Microsoft 365 **Security**, **Directory Roles** and **Devices** at **Write** with **Approval** on, but no step uses them. Add a step if you want the agent to revoke the user's sign-in sessions, remove admin roles, or wipe or retire their devices. A device wipe always asks a technician, whatever the group's setting.

## Set it up

**1. Start from the template**

Open the template for your PSA from the table above. The agent opens with **Test Mode** on, so nothing changes in your systems until you turn it off.

On **Triggers & Filters**, **Trigger When** is **Manual Only**: the agent runs only when a technician starts it on a ticket. If your PSA has the [Neo panel](https://docs.neoagent.io/integrations/psa/neo-panel/setup.md#choose-the-agents-in-the-panel), turn on **Show in PSA Pod** so technicians can start it from the ticket.

**2. Choose who approves**

On **Tools & Settings**, under **Approvals**, open **Request Technician-in-the-Loop Approval**. The template ships with no approvers, and Neo does not save the agent until it has one. Pick people under **Technicians-in-the-loop who can approve actions**, or a channel under **Teams or Slack channels & chats that can approve**. Each approver needs the Neo AI Agent app in Teams ([Technician-in-the-Loop](https://docs.neoagent.io/core/technician-in-the-loop.md)).

**Change License Seats** ships with **Allow removing seats** on, **Allow adding seats** off and **Approval** on. It needs a [license marketplace integration](https://docs.neoagent.io/integrations/marketplaces/intro.md). Without one, the agent cannot lower the seat count. Removing the last seat never cancels a subscription ([Change License Seats](https://docs.neoagent.io/agents/tools/m365/change-license-seats.md)).

![Request Technician-in-the-Loop Approval settings: approval channels, Who receives approval requests and the approvers list](https://mintcdn.com/neoagent/u95ne_lKoQa74zsB/images/recipes/til-approval.webp?fit=max\&auto=format\&n=u95ne_lKoQa74zsB\&q=85\&s=a881ec7c1e12b3c7524a8be60098bdaf)

**3. Check the permissions**

On the same tab, under **Identity & Workspace**, the template sets:

* **Microsoft 365 Admin (Cloud)**: **User Management**, **Groups**, **Security**, **Licensing**, **Directory Roles** and **Devices** at **Write** with **Approval** on.
* **Exchange (Online/Cloud and On-Prem)**: **Mailboxes** and **Mailbox Permissions** at **Write** with **Approval** on.
* **Active Directory (On-Prem)**: **User Management** and **Groups** at **Write** with **Approval** on, and **Entra Connect Sync** at **Write**.

With **Approval** on, Neo holds each change until a technician approves it, then makes it. Keep it on for an offboarding agent. Do not click a preset here: on **Microsoft 365 Admin (Cloud)**, **IT Admin** keeps approval only on Applications, Conditional Access, Directory Roles and Defender Indicators, and **Full Automation** keeps none.

Under **PSA**, check the groups in the table at the top of this page. On Syncro, set **Contacts** and **Client-Facing Notes** to **Write** if you want steps 8 and 10.

![M365 User Offboarding Microsoft 365 Admin (Cloud) permissions: Devices, Directory Roles, Groups, Licensing, Security and User Management at Write with Approval on](https://mintcdn.com/neoagent/Ay3PPakIrk7J4Ca5/images/recipes/m365-offboarding-permissions.webp?fit=max\&auto=format\&n=Ay3PPakIrk7J4Ca5\&q=85\&s=76ed19e5d88ee0ac6813a8399b399fec)

**4. Fit the instructions to your process**

Under **Custom Instructions**, replace the template values with yours:

* The titles that may request a termination (step 1).
* The documentation title "User Termination" (step 2). If your SOP has another title, use it, or remove the step.
* The contact Title format `Terminated %MM/DD/YY% - %Ticket ID%` (step 8).

Step 1 tells the agent to message Admins and HR when the requester is not on the list, but the template has no email or Teams tool. Turn on **Send Email** under **Messaging** for that step, or change it to "add an internal note and stop".

**5. Test on a test user**

Create a test user in the client's Microsoft 365 tenant, for example `test.leaver@contoso.com`, with a license, a mailbox and two group memberships. Open a termination ticket for that user from an authorized contact.

1. With **Test Mode** on, click **Run** in the agent's header. Pick **Real ticket from PSA**, enter the ticket under **Ticket IDs**, and run. Neo reads your live tenant but changes nothing, and posts its plan as an internal ticket note (**Report test results via**). Exchange PowerShell does not run in Test Mode, even to read ([why](https://docs.neoagent.io/agents/tools/m365/overview.md#test-mode)).
2. Turn **Test Mode** off and run the agent on the same ticket again, with **Supervised run** on. Approve each change and check the result in the Microsoft 365 admin center and your PSA.
3. Read each run on [**Activity**](https://dashboard.neoagent.io/executions). Delete the test user when you are done.

Only then use the agent on a real leaver. The **Approval** switches still hold each Microsoft 365, Exchange and Active Directory change.

## Variations

### Start automatically on termination tickets

On **Triggers & Filters**, change **Trigger When** to **Ticket Created** and add a filter for your termination ticket type under **Filter Tickets**. Without a filter, the agent runs on every new ticket.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.