Q&A: Will my empty class be deleted automatically?

Question:

Will my empty class be deleted automatically?

Answer:

No, in principle, classes are “only” groups, so a group is retained if you remove the users.

To find empty classes you can use these filters:
Replace OU in the first command

univention-ldapsearch '(&(!(uniqueMember=*))(!(memberUid=*)))' -b cn=klassen,cn=schueler,cn=groups,ou=<OU>,$(ucr get ldap/base) 1.1

or

univention-ldapsearch '(&(!(uniqueMember=*))(!(memberUid=*))(objectClass=ucsschoolGroup))' 
Mastodon