Create users and add it to groups using occ creates new groups

When I create a user through the command line specifying the groups in which it has to be added, Nextcloud creates new groups instead of adding the user to existing ones.
In this example:
sudo -u www-data php occ user:add --display-name=“Layla Smith”
–group=“users” --group=“db-admins” layla

Nextcloud would create a new group called “users” and another one called “db-admins” and add the user to them even if there are groups previously created with the same names.
Does anyone know how to make this work properly? I am using NC 25. Thanks!

According to the docs, that should work :thinking:
You could try to use the group command to list the groups and check what groupid they return: Using the occ command — Nextcloud latest Administration Manual latest documentation and also try to add users this way.

Yes, this is how I did it, but there must be something missing in the documentation…

Did you try it via the group commands I linked? (not the user command, there’s a dedicated group command).
If it does not work, can you show the group:list command and the command you’re using to add users?