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

> ## Agent Instructions
> Mono is an AI platform for small and medium-sized firms in Switzerland, Germany, Austria and Italy. Answer in the reader's language. Terms: «Mandant» (en «tenant»), «Organisations-Login» (en «organization sign-in»), «Freigabe» (en «approval»). Reading needs no approval; every write waits for one. Never suggest pasting a key or token into a chat.

# Connect an on-premises Active Directory

> Let Mono read people, groups and photos from the Active Directory or an LDAP server on site, through the Mono Connector and without any password passing through Mono.

Afterwards Mono knows the people, groups and photos of your Active Directory. A Mono Connector (Connects devices on site to the Node, outward only.) at your site reads the AD read only and sends the result to the Node.

> [!NOTE]
>
> No password ever passes through Mono. The Node never asks for an AD password and never signs anyone in over LDAP. Your employees sign in through AD FS, Keycloak or SAML.

> [accordion] What you need
>
> * The Admin role in your tenant (A company, an IT partner or a private person in Mono, with its own sign-in and its own data.).
> * A device in the internal network that reaches the domain controller, with Linux or Docker. The Mono Connector runs on it.
> * A service account in the AD with read rights on the base, without write rights and never a domain admin, for example `CN=svc-mono,OU=Dienste,DC=muster,DC=intern`.
> * LDAPS (`ldaps://`) or LDAP with StartTLS.
> * For the sign-in: AD FS, Keycloak with an LDAP connection or a SAML provider. This is how: [SAML and OpenID Connect](https://mono.mintlify.site/en/admins/saml-oidc.md).

```mermaid theme={"system"}
flowchart LR
  AD[(Active Directory)] -- LDAPS, read only --> C[Mono Connector on site]
  C -- outward only --> N[Node]
  P[Employees] -- sign-in --> F[AD FS, Keycloak or SAML]
  F --> N
```

## Connect the AD

**1. Start the pairing**

Open Connectors › “Pair device” or Operations › “Add” › “Pair a device at a site”. The Console shows a pairing code (You use it to pair a Mono Connector and to check that it is the right device.) and the line for the device. The whole pairing is described under [Pair a Mono Connector](https://mono.mintlify.site/en/admins/pair-connector.md).

**2. Run the line with the AD details**

Run the line on the device and append the AD details. The Mono Connector reads the service account’s password from a file that only root may read.

```bash Linux theme={"system"}
curl -fsSL --proto '=https' --proto-redir '=https' --max-redirs 2 https://ki.muster.example/connector/install.sh | sudo bash -s -- --code 7Q4K-2D9M \
  --directory "AD Chur=ldaps://dc01.muster.intern" \
  --directory-base "DC=muster,DC=intern" \
  --directory-user "CN=svc-mono,OU=Dienste,DC=muster,DC=intern" \
  --directory-password-file /root/ad.password
```

```bash Docker theme={"system"}
curl -fsSL --proto '=https' --proto-redir '=https' --max-redirs 2 https://ki.muster.example/connector/install.sh | sudo bash -s -- --mode docker --code 7Q4K-2D9M \
  --directory "AD Chur=ldaps://dc01.muster.intern" \
  --directory-base "DC=muster,DC=intern" \
  --directory-user "CN=svc-mono,OU=Dienste,DC=muster,DC=intern" \
  --directory-password-file /root/ad.password
```

With `ldap://` you also need `--directory-starttls`. With `--directory-pin` you pin the domain controller’s certificate (SHA-256).

**3. Compare the verification code**

The device shows a verification code. Compare it in the Console and choose “Code matches, pair”.

**4. Choose “Connect Active Directory”**

Open Access › Groups and roles › “Link rights”. In the “Directory” step, choose “Connect Active Directory”. No consent is needed: the Mono Connector reads the AD right away.

> [tab] In the Console
>
> The steps above. If you also have Entra ID or Google Workspace, the wizard offers the other directory under “Instead:”.

> [tab] In the chat
>
> After the pairing, ask “Mono Admin”:
>
> Connects the AD that the Mono Connector offers.
>
> Connect our Active Directory and link the groups to roles.
>
> Mono asks back with “Please confirm”. The pairing itself needs the verification code on the device.

> [!TIP]
>
> “People, groups and photos appear in a few seconds. The password stays on the device.” Afterwards the groups show “from the AD”.

> [accordion] What happens next?
>
> * The device reads the AD every 15 minutes. “Sync now” under Access › Groups and roles asks it to do so immediately.
> * Mono resolves nested groups and also reads large groups completely.
> * Photos come from `thumbnailPhoto` or `jpegPhoto`, job title and department from the AD. In Mono they are read only and marked “from the AD”.
> * Anyone disabled in the AD loses access at the next sync.
> * Mono links a sign-in through AD FS, Keycloak or SAML to the person in the AD by the verified email address or by a sign-in name the provider vouches for: the UPN for AD FS, the NameID within your domains for SAML.

> [accordion] Why does the device read and not the Node?
>
> The Node only connects outward and has no open port at your site. That is why a device in the internal network reads the AD and sends the result out. The service account’s password stays on the device: under systemd as a credential, in Docker as a secret, never in the settings file and never at the Node.

> [accordion] Windows and macOS
>
> The Mono Connector’s installers for Windows and macOS don’t ask for the AD details yet. Today you use a device with Linux or Docker in the same network for this.

> [accordion] Undo
>
> Under Access › Groups and roles, at “Directory”, “Disconnect …”. The groups then come from the sign-ins again; the links remain. You unpair the device under Connectors.

> [accordion] If something doesn't work
>
> | Message | What helps |
> | - | - |
> | “Der Mono Connector «…» meldet sich gerade nicht. …” (the Mono Connector “…” isn’t responding right now; Mono continues as soon as it is online) | Check under Operations › Sites whether the device is online. |
> | “Sync failed: …” | Check the address, base, service account and certificate. Then “Sync now”. |
> | “Directory too large” | Narrow down the base, for example to one OU. |

## Several domain controllers and sites

If a domain controller fails, the device reads from the next one. If devices at several sites read the same AD, Mono takes the first complete round per sync. For admins.

**1. Name several domain controllers**

In `--directory`, give the domain controllers in the order you want, separated by commas – or `srv:<domain>`, and the device reads your DNS SRV records at each sync.

```bash theme={"system"}
--directory "AD=ldaps://dc01.muster.intern,ldaps://dc02.muster.intern"
--directory-pin "dc01.muster.intern=AB:CD:…,dc02.muster.intern=EF:01:…"
```

Each domain controller has its own fingerprint. If one does not answer, the device takes the next. If a certificate does not match, the sync stops there – never a switch to the next one.

**2. Pair another device at another site**

At the second site, pair a device with the same AD settings (the same base). Mono recognises the same directory and adds the device – without another click.

In the chat: “How is our Active Directory doing?” – `access_overview` names the sites and every domain controller without an answer.

> [!TIP]
>
> Under Access › Groups and roles, the “Directory” box shows “Read at 2 sites”; a domain controller that does not answer is one line there.

> [accordion] When something goes wrong
>
> | What you see | What helps |
> | - | - |
> | “Domain controller … does not answer – another one reads” | The sync goes on. Check the named domain controller. |
> | “No Mono Connector has reported the directory for over an hour.” | Every site is silent. Check under Operations › Sites whether the devices are online. Until then the last sync stays in force. |
> | “The directory server’s certificate does not match the stored fingerprint.” | The fingerprint belongs to another domain controller or has changed. Enter it again. |
> | “DNS names no domain controller for the domain (SRV record).” | Check the domain after `srv:` or name the domain controllers one by one. |

## Next

> [card] [Pair a Mono Connector](https://mono.mintlify.site/en/admins/pair-connector.md)
>
> The pairing on every system.

> [card] [SAML, AD FS, Keycloak or OpenID Connect](https://mono.mintlify.site/en/admins/saml-oidc.md)
>
> The sign-in for the AD.

> [card] [Link groups and roles](https://mono.mintlify.site/en/admins/groups-and-roles.md)
>
> Groups from the AD with roles.

> [card] [On Windows Server](https://mono.mintlify.site/en/admins/windows-server.md)
>
> What runs on a Windows server.


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