Skip to content
Docs

Self-hosted rollout with Microsoft 365

This page is the path for an organization that:

  • runs AgentWatch on its own infrastructure,
  • signs in with Microsoft Entra ID (Azure AD),
  • wants AgentWatch email sent through Microsoft Graph rather than SMTP,
  • deploys software to Windows with an RMM tool, and to Macs with an MDM.

Do the parts in order. Each one ends with a check, so a mistake shows up where it was made and not three steps later. Plan on half a day for the server, SSO and email, plus a pilot of two or three computers per operating system.

Part What you do Who Time
1 Install AgentWatch, give it a trusted HTTPS name Server admin ~1 hour
2 SAML sign-in + SCIM provisioning from Entra Entra admin + AgentWatch admin ~45 min
3 Entra app with Mail.Send, then AgentWatch email settings Entra/Exchange admin ~20 min
4 One PowerShell script in your RMM Endpoint admin ~30 min + pilot
5 One profile + one package in your MDM Endpoint admin ~30 min + pilot
6 End-to-end check Anyone 10 min

The pictures of Microsoft and RMM screens are drawn illustrations, labelled as such in their corner: the portals change their layout often, and the field names are what to look for. Pictures of AgentWatch screens are taken from the console.

Follow the Quick Start. In short: on a Linux host with at least 4 vCPU, 16 GB RAM and 20 GB SSD (see Deployment for larger tiers), download the two files, set the secrets in .env, sign in to the registry with the access token Iterate.ai issued you, and run docker compose up -d.

Three things matter for the rest of this page:

  1. A public, trusted HTTPS name, for example https://agentwatch.contoso.com. Entra’s SCIM provisioning and SAML both run from Microsoft’s cloud to your server. They reject self-signed certificates and need to reach the host on 443. If the server must stay internal, publish only /scim/v2/* and /api/auth/saml/* through your reverse proxy or Entra Application Proxy.
  2. Outbound HTTPS from the server to login.microsoftonline.com and graph.microsoft.com (for email), and to the AI providers you allow.
  3. Computers must reach the same name on 443. Connect talks to it to enroll and to send what it captures.

Check:

Terminal window
curl -s https://agentwatch.contoso.com/health
# {"ok":true,"version":"2.0.424",...}

Sign in as the initial admin and keep this browser tab open.

Part 2 — Sign in with Microsoft Entra ID

Section titled “Part 2 — Sign in with Microsoft Entra ID”

Use SAML for sign-in and SCIM for provisioning, in one Entra Enterprise application. Employees then exist in AgentWatch before their computers enroll, and someone disabled in Entra is disabled in AgentWatch too. The full reference, including the OIDC alternative and every error code, is SSO & SCIM Setup — Microsoft Entra ID.

You need Application Administrator (or Cloud Application Administrator / Global Administrator) in Entra, and Company Admin in AgentWatch.

Step 2.1 — Create the Enterprise application in Entra

Section titled “Step 2.1 — Create the Enterprise application in Entra”
  1. Entra admin center → Enterprise applications → All applications → + New application.
  2. + Create your own application. Name: AgentWatch.
  3. Choose Integrate any other application you don’t find in the gallery (Non-gallery) → Create.

Create your own application: name AgentWatch and the Non-gallery option selected

Step 2.2 — Download Entra’s SAML metadata

Section titled “Step 2.2 — Download Entra’s SAML metadata”
  1. In the new app: Single sign-on → SAML.
  2. In section 3 — SAML Certificates, download Federation Metadata XML. Section 4 shows the Login URL and Microsoft Entra Identifier. The metadata file carries both, plus the certificate.

SAML Certificates with Federation Metadata XML download, and the Login URL and Microsoft Entra Identifier values

Step 2.3 — Create the SAML provider in AgentWatch

Section titled “Step 2.3 — Create the SAML provider in AgentWatch”
  1. AgentWatch → Settings → Single Sign-On → + Add Authentication → SAML → Next.
  2. Upload the Federation Metadata XML. It fills the SAML Entry Point, SAML Issuer (https://sts.windows.net/<tenant-id>/) and the certificate.
  3. Display Name: Contoso Entra ID. At the bottom of the form, tick Enabled and Auto-create users.

The AgentWatch SAML form, lower half: the certificate, Group Claim Key, and the Enabled and Auto-create users boxes ticked

  1. Click Next. AgentWatch saves the provider, and the Connection step now shows, under 2. Register in your IdP, the values Entra needs: ACS URL and SP Entity ID (plus a Single Logout URL). Click Back if the wizard moved on to Test. Copy both.

The AgentWatch SAML Connection step with the Entra values filled in on the left and the ACS URL, SP Entity ID and Single Logout URL to copy on the right

Both URLs contain the provider’s ID. If you ever delete and recreate the provider, copy them into Entra again.

Both URLs start with your server address followed directly by /api/auth/saml/. On AgentWatch 2.0.424 and earlier, the wizard could show an organization path in between (https://agentwatch.contoso.com/<org>/api/auth/saml/...). Entra then refuses the sign-in. Remove that part, or upgrade and copy the values again.

Step 2.4 — Give Entra the AgentWatch URLs

Section titled “Step 2.4 — Give Entra the AgentWatch URLs”

Back in Entra → the app → Single sign-on → 1 Basic SAML Configuration → Edit:

Entra field Paste
Identifier (Entity ID) AgentWatch SP Entity ID
Reply URL (Assertion Consumer Service URL) AgentWatch ACS URL

Leave the other fields empty and click Save. Entra’s default claims work unchanged: AgentWatch reads the email from emailaddress (or from the UPN).

Basic SAML Configuration: Identifier and Reply URL filled with the AgentWatch URLs, then Save

The app → Users and groups → + Add user/group → choose a group such as AgentWatch Users → Assign. Only assigned people can sign in, and only they are provisioned in step 2.7.

Users and groups with the AgentWatch Users group assigned

Finish the AgentWatch wizard with Enable this provider for sign-in immediately ticked. Then, in a private browser window, open AgentWatch, type your work email, click Continue and sign in with Microsoft. You should land on the AgentWatch dashboard. Test from the AgentWatch login page, not Entra’s Test button, which starts a different flow.

  1. AgentWatch → Settings → Single Sign-On → User & Group Sync: copy the SCIM Base URL (https://agentwatch.contoso.com/scim/v2/<tenant-uuid>), click + Generate Token and copy the scim_… token. It is shown once.

AgentWatch User &amp; Group Sync: the SCIM Base URL with its copy button, and Generate Token

  1. Entra → the same app → Provisioning: Provisioning Mode Automatic; Tenant URL = the SCIM Base URL (no trailing slash); Secret Token = the token. Click Test Connection, then Save.
  2. Mappings: leave Entra’s defaults. Turn groups on if you want Entra groups as AgentWatch teams.
  3. Settings → Scope: Sync only assigned users and groups, Provisioning Status: On, Save.

Provisioning: Automatic mode, the AgentWatch SCIM URL as Tenant URL, the token, and a successful Test Connection

The first cycle takes 10–40 minutes. Provision on demand at the top of the page pushes one person straight away.

Check: Employee Management lists the assigned people. People created by SSO or SCIM get the role User. To make a group’s members Company admins, add a rule under Settings → Single Sign-On → SSO Group Mappings → New Mapping. A mapping can set only User or Company admin; custom roles are assigned by hand.

AgentWatch sends welcome emails, sign-in codes, and budget and rate-limit alarms. With Microsoft Graph there is no SMTP password and no SMTP port. Full page: Email through Microsoft Graph.

  1. Entra → App registrations → + New registration, name AgentWatch Mail, single tenant, Register. Copy the Application (client) ID and Directory (tenant) ID.
  2. Certificates & secrets → + New client secret → copy the Value (not the Secret ID).
  3. Grant Mail.Send as an Application permission. Either add it under API permissions and click Grant admin consent (it can then send as any mailbox), or, recommended, scope it to one shared mailbox with Exchange RBAC for Applications. The commands are on the full page.
  4. AgentWatch → Management → Company Settings → Email Notifications: tick Enable, choose Microsoft 365 (Microsoft Graph), set the From Address to the shared mailbox (for example agentwatch@contoso.com), and paste the tenant ID, client ID and secret. Click Save email settings, then Send test email.

API permissions: Mail.Send as an Application permission with admin consent granted

AgentWatch Email Notifications with Microsoft 365 (Microsoft Graph) selected, the tenant ID, client ID, client secret and optional sender mailbox, and the Send test email and Save buttons

Check: Test email sent successfully, and the message is in your inbox. If not, the error names the cause. See the troubleshooting table.

Part 4 — Windows computers through your RMM

Section titled “Part 4 — Windows computers through your RMM”

One PowerShell script, run by your RMM as SYSTEM, writes Connect’s managed settings, downloads the installer from your AgentWatch server, checks its signature, installs it silently and confirms the service. Full page with the script: Deploying Connect on Windows with an RMM.

  1. AgentWatch → Agent Fleet → Agent Connect Settings: copy the Enrollment Token.
  2. In your RMM, create a PowerShell script: run as System, 64-bit, with a secure variable AW_ENROLLMENT_TOKEN holding the token.
  3. Paste the script from the RMM page and set your AgentWatch address and email domain at the top.
  4. Run it on two or three pilot computers. The output ends with AgentWatch Connect installed and running.

Generic RMM script settings: PowerShell, run as System, 64-bit, the secure token variable and a pilot group

On Entra-joined PCs, Connect enrolls the signed-in user by their Entra sign-in address with no prompt, which is why provisioning in Part 2 comes first.

Check: the computers are Online in Agent Fleet under the right people.

Two pushes to the same device group, in either order: the configuration profile (certificate + settings) at device level, and the signed package. Full page: Deploying Connect on macOS with an MDM.

  1. AgentWatch → Agent Fleet → Deploy with an MDM: type your email domain, then download macOS → Installer (.pkg) and Settings (.mobileconfig).
  2. In your MDM, upload the .mobileconfig unchanged as a custom profile on the device channel (Intune) / at computer level (Jamf, Kandji, JumpCloud).
  3. Upload the .pkg as a required app or package.

Agent Fleet → Deploy with an MDM with the macOS installer and settings downloads

Intune macOS Custom profile on the Device channel

Check: the menu-bar icon shows Connected, and the Mac is Online in Agent Fleet with CA trusted on.

# Check Expected
1 Private window → AgentWatch → work email → Microsoft sign-in Dashboard opens
2 Disable a test user in Entra, then Provision on demand The user is disabled in Employee Management
3 Send test email in Email Notifications Arrives from the shared mailbox
4 Agent Fleet Each pilot computer Online, right person, CA trusted
5 On a pilot computer, ask a public AI assistant What is the capital of France? in a new tab Appears in Usage Insights under that person within seconds
6 Paste a fake card number such as 4111 1111 1111 1111 into the same assistant Redacted or blocked, per your Settings → Company Policy → Data Protection

Then widen the Entra assignment, the RMM target and the MDM group in steps.