Sync Active Directory Users with ONLYOFFICE DocSpace via LDAP

To sync LDAP or Microsoft Active Directory accounts with ONLYOFFICE DocSpace, enable LDAP Authentication under Settings > Integration > LDAP Settings, enter the directory connection and search parameters, then save and confirm the import. Enable Auto sync afterward so directory changes continue to reach DocSpace without repeating the initial setup.

This procedure applies to DocSpace's LDAP integration, not to a standalone ONLYOFFICE Docs document-editing server. For ONLYOFFICE Workspace, the equivalent settings are under Control Panel > Portal Settings > LDAP. According to the current ONLYOFFICE documentation checked in October 2026, LDAP is a paid Business feature in the DocSpace SaaS offering; check the capabilities of your particular self-hosted edition separately. See the official DocSpace LDAP reference and the Workspace server instructions.

Plan a small directory import first

Illustrative scenario: Acme Corp has an Active Directory domain named acme.local. Its IT administrator wants a DocSpace account for each employee in the Employees organizational unit (OU), while optionally importing security groups from a separate Groups OU. The names, paths, and account examples below are hypothetical configuration values, not results from a deployed environment.

Before touching DocSpace, confirm that its server can reach a domain controller, determine which accounts must be included, and arrange a directory account with read access. Use a dedicated read-only service identity rather than a domain administrator. Record the exact LDAP distinguished names (DNs), which identify directory locations, and the login and email attributes already used in AD.

Active Directory Users and Computers displaying the sample acme.local domain with Employees and Groups organizational units
The sample Active Directory tree helps identify the employee and group search bases before importing accounts.

Acme's example search base is OU=Employees,DC=acme,DC=local. Starting at this OU reduces the chance of importing service accounts or unrelated users. For an existing portal with users or documents, create a suitable backup and verify recovery procedures before changing LDAP filters: ONLYOFFICE warns that changes to server, user, or group search settings can affect previously imported accounts and their data. Review its backup and restore documentation.

Connect DocSpace to the directory

1. Open LDAP Settings and enable authentication

Sign in as a DocSpace administrator. From the lower-left options menu, choose Settings, then open Integration > LDAP Settings. Turn on LDAP Authentication; if the configuration form is collapsed, use Show to expand it. Do not mistake the separate SAML single sign-on page for LDAP synchronization.

ONLYOFFICE DocSpace Settings navigation with Integration selected and LDAP Settings highlighted
Open Integration and choose LDAP Settings in DocSpace before enabling directory authentication.

2. Select a protected LDAP transport

Choose Enable StartTLS for an LDAP connection upgraded to TLS, normally on TCP port 389, or Enable SSL for LDAPS, normally on TCP port 636. For the Acme scenario, suppose its domain controller is configured for LDAPS with a valid server certificate: use LDAPS://dc1.acme.local and 636. Choose one supported secure method; do not send bind passwords over unprotected LDAP.

LDAP Authentication enabled alongside an LDAP server address port 389 and the Enable StartTLS setting
The LDAP configuration area shows the StartTLS option and the corresponding default port 389.

LDAPS on an AD domain controller requires an appropriate certificate, a matching DNS name, and network access. Microsoft documents these requirements in Configure certificates for LDAP over SSL. Resolve certificate trust problems on the server rather than weakening TLS validation.

3. Enter the server and bind credentials

Set Server to the LDAP or LDAPS URL and Port Number to the selected port. Enable the form's Authentication option when a directory account is needed to read user and group records, and enter the authorized login and password. The sample service identity might be svc_docspace@acme.local; use your directory's actual accepted bind format. Passwords and real account names should never be placed in a published guide or screenshot.

LDAP settings form showing example directory server address base DN and a masked service account password
Review the server address and example bind credentials without exposing an actual service account password.

Choose exactly which users to import

4. Define the search base and filter

Enter OU=Employees,DC=acme,DC=local in User DN. For Active Directory, the ONLYOFFICE-recommended starting filter is (userPrincipalName=*). This selects records with a user principal name within the selected search scope; it is not, by itself, a guarantee that every result is an enabled human employee. Review the OU contents or use a carefully validated filter if your organization requires narrower membership.

LDAP directory search panel with User DN and userPrincipalName user filter fields
Set the user search DN and an Active Directory user filter to limit which records may be imported.

In an OpenLDAP directory, the documented defaults are different: (uid=*) for User Filter and uid for Login Attribute. Do not copy those defaults unchanged into an Active Directory deployment.

5. Set the login attribute and map profile data

For AD, set Login Attribute to sAMAccountName, as the ONLYOFFICE instructions specify. The configured login attribute determines what users type at the DocSpace sign-in page; supported formats include the simple login, login plus LDAP domain, and domain backslash login. Test the format with a nonadministrator employee account after import.

ONLYOFFICE LDAP Login Attribute field set to sAMAccountName
The sAMAccountName value is the documented starting login attribute for Active Directory.

In Attribute Mapping, map First Name to givenName, Second Name to sn, and Mail to mail when those fields exist in your AD schema. These are example mappings to check against your actual directory, not assumed values for every environment. Email matters: ONLYOFFICE says the Mail mapping is used for the DocSpace email address; missing mail data may produce an address derived from the login and LDAP domain and can prevent notifications from reaching the user.

ONLYOFFICE attribute mapping fields showing givenName sn and mail
Match first name, last name, and email fields to the corresponding LDAP attributes.

Import groups, then turn on ongoing synchronization

6. Configure optional group membership

If Acme also wants directory groups, enable Group membership. In this example, use OU=Groups,DC=acme,DC=local for Group DN and (objectClass=group) for Group Filter. The AD mapping documented by ONLYOFFICE uses distinguishedName as User Attribute and member as Group Attribute; use the existing Group Name Attribute appropriate for the directory.

ONLYOFFICE LDAP user and group settings showing enabled group synchronization and a group base DN
Configure optional group membership only after confirming that intended users belong to matching groups.

Check membership before saving: ONLYOFFICE explicitly notes that enabling group import restricts the imported users to those who belong to at least one matching group. If Acme's pilot employees do not belong to the selected groups, leave group import off initially or correct the directory scope before import. Do not expand the group filter across the entire domain merely to make the user count larger.

7. Save the configuration and confirm the import

Review the search bases, account mappings, and intended directory membership, then click Save. In the Confirmation of import dialog, select OK to begin. Allow time for the directory search and import; the duration depends on the environment. For a large AD deployment, the ONLYOFFICE documentation calls out a 1,000-entry AD query limit. Coordinate any paging or directory-limit changes with the AD administrator rather than changing domain-controller settings without review.

Check the imported accounts in Accounts; LDAP-linked profiles have an LDAP indicator in the administrator view. Keep the first run deliberately narrow so a wrong filter, mail mapping, or group rule can be corrected before adding the full organization. Avoid claiming that a successful save proves users can authenticate.

8. Schedule Auto sync and run one manual sync

Back on LDAP Settings, enable Auto sync and choose an interval supported by your DocSpace version: hourly, daily, weekly, or monthly. Save the schedule. For an immediate update, select Sync users at the bottom of the LDAP page. ONLYOFFICE also documents per-user updates after an LDAP user logs in; that login behavior is not a substitute for regular directory-wide synchronization when groups and account records need refreshing.

Verify sign-in and the next update

Use a pilot employee account to sign in with its AD credentials, then confirm that the DocSpace profile shows the expected name and email address. If groups were enabled, verify the employee belongs to an imported group and can access only the rooms granted through DocSpace permissions. Finally, change a noncritical directory field on the pilot account, run Sync users, and check that its DocSpace profile reflects the change.

  • No users appear: recheck User DN, the filter, the service account's read access, and whether enabling Group membership excluded the pilot users.
  • Authentication fails: confirm the login attribute, the account's directory status, network access, and TLS certificate trust.
  • Names or email are wrong: compare the mapped LDAP attributes with the actual directory record before changing an established search scope.
  • Later changes do not appear: verify Auto sync was saved, run Sync users manually, and check whether the modified account remains within the configured filters.

The setup is confirmed only when the selected users are imported, a pilot user can authenticate with directory credentials, the intended group restrictions apply, and at least one later profile change synchronizes correctly.

Leave a Comment

Clear Nextcloud’s File Locking Warning with Redis

Enable reliable Nextcloud file locking, choose the right Redis or Valkey backend, and verify the warning clears without risking concurrent file changes.

What It Takes to Target an A+ Nextcloud Security Rating

What It Takes to Target an A+ Nextcloud Security Rating

Fix common Nextcloud scan findings with current updates, HTTPS and HSTS, precise reverse-proxy trust, and checks against the public server.

Automate Consistent Nextcloud Backups with Restic and Cron

Automate Consistent Nextcloud Backups with Restic and Cron

Back up Nextcloud’s files and MariaDB together, schedule encrypted Restic snapshots with cron, and verify recovery without risking the live server.

Enable Nextcloud Server-Side Encryption with Measured Impact

Configure Nextcloud SSE for the storage that needs it, protect encryption keys, and measure transfer and CPU impact before encrypting existing files.

Add Elasticsearch Full-Text Search to Nextcloud

Connect Nextcloud’s file search to Elasticsearch, index document contents, and choose a setup that fits your server and security needs.

Set a Reliable Expiration Policy for Nextcloud Deleted Files

Set a Reliable Expiration Policy for Nextcloud Deleted Files

Configure Nextcloud to remove deleted files after a defined retention period, schedule background jobs reliably, and avoid commands that purge every user’s trash.

Clear Nextcloud’s Missing Database Indexes Warning

Clear Nextcloud’s Missing Database Indexes Warning

Run Nextcloud’s OCC repair safely, preview the database changes, and check why the warning might remain.

Raise Nextcloud’s Web Upload Limit Past 2 GB

Raise Nextcloud’s Web Upload Limit Past 2 GB

Allow larger Nextcloud browser uploads by aligning PHP, Nginx or Apache, temporary storage, and timeout settings—and verify which limit is blocking the file.

Clear Nextcloud’s PHP Memory Warning at the Web Server

Set the PHP memory limit Nextcloud actually uses, restart the right service, and confirm the 512 MB setting in Admin Overview.

Connect an S3-Compatible Bucket to Nextcloud External Storage

Mount a compatible object-storage bucket in Nextcloud using its S3 backend, with the right endpoint, credentials, access scope, and verification steps.