How to create a corresponding group based on the OU (organizationalUnit) name of MS-AD

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 29.0.0
Operating system and version (eg, Ubuntu 20.04): CentOS7.9
Apache or nginx version (eg, Apache 2.4.25): APache 2
PHP version (eg, 7.4): 8.2

The issue you are facing:
Unable to create group using OU

Is this the first time you’ve seen this error? (Y/N):

Steps to replicate it:

  1. LDAP:(|(objectClass=posixGroup)(objectClass=organizationalUnit))
  2. LDAP:(|(objectClass=ou)(objectClass=organizationalUnit))

But I can’t find this group in NC

Please help me, how should I set it up

Using (| (objectClass=organizationalUnit)) to filter can successfully import groups named OU

But I don’t know how to associate users with corresponding groups
Example: This user is a user under OU=“department A”, who is imported into nextcloud. He should have joined the department A group

Organizational Units are different concept than groups. Users are member of the group and this is reflected in the memberOf attribute of the user and members attribute of the group, while OU is not really part of the user object

Yes, I can understand. OU is not really part of the user object
However, in the organization and management of time, users belong to a certain OU, and there is a hierarchical relationship between OUs.
If I transform OU into a group in NC, it will form a clear organizational structure.
User A is a department A group, which belongs to the AA group, which in turn belongs to the organization (company group).