UCS@School CSV import with multiple classes



Using the CSV import function, how do you import a teacher/student into multiple classes? In the Google German > English translation of the manual it’s not very clear. I Have 2000 faculty/staff/students to import and I can’t/won’t manually enter them into multiple classes.

Also, how does the class being given an email address get interpreted by the Google Apps module when it syncs?

Why is there no freaking method to import the user ID number, unix home directory location, contact info, and groups (classes or otherwise)? These are all very basic things that should be importable.

WHY are there three different fields for email? One under Contact, one under Google Apps, and one under Advanced Settings > Mail. I mean really? Why can’t you just use ONE email address field??? And I should be able to CSV import to any of them.



welcome to UCS@school. I guess it is very difficult to work with it, all the documentation being in German. Please keep the tone civil, as there is a good reason for everything and a solution to most problems. I will try to help you importing the users.

The first thing I need to better understand your problems is information:

  • What version of UCS and UCS@school are you using? The command univention-app info returns that information.
  • How did you try to import users? Did you use the graphical UMC module or the command line tools?
  • Where does the CSV come from? Will the source database be updated regularly, requiring a regular import → update of the users in UCS?
  • It seems you wish to use the gapps connector. Should all users be synced to google or do you wish to select a group etc?

In http://docs.software-univention.de/ucsschool-import-handbuch-4.2.html#configuration:mapping there is an example of a CSV file. As classes are really groups, they must be unique throughout a domain. That is why their names are constructed like this: <school name>-<class name>. To import a user into multiple classes (and possibly multiple schools), separate the class names by comma: school1-class1,school1-class2,school2-class1.

If you import a user into classes of multiple schools, you must list those schools in the schools column of the CSV file. But the UMC module for CSV-import does currently not support users in multiple schools. You’d have to use the command line tools for that.

The email address (UDM attribute mailAddress) will be set as the email address of that group in the google directory.
The gapps connector only syncs groups if the UCR variable google-apps/groups/sync is enabled. If you change that after creating groups, they won’t be synced. You can trigger the listener to resync all groups by running univention-directory-listener-ctrl resync google-apps-group.

It is possible to import those. You’d have to use the new import script /usr/share/ucs-school-import/scripts/ucs-school-user-import It can set all possible UDM attributes. The mapping of CSV columns to user attributes is defined in a JSON file.

It is however much safer and probably also much easier to let UCS@school create the users with fresh UIDs and unix homes and then move and chown existing user data into the new directories.

In UCS@school the directories used for user homes are separated by school name (OU) and user type. I don’t think this is still strictly necessary, but I am not certain.

To import groups, there is a import_group script in /usr/share/ucs-school-import/scripts/.

The three email fields serve different purposes:

  • Primary e-mail address (mailPrimaryAddress): the users mailbox, must be unique and the domain must be registered as mail domain in UCS → will be served if the mailserver app is installed
  • Alternative e-mail address (mailAlternativeAddress): list of aliases, all mails to those addresses listed here will be delivered to the users mailbox (primary address), does not need to be unique but the domain must be registered as mail domain in UCS
  • contact → E-mail address: a list of contact email addresses, can be external domains, just for the address book - will not be served by a UCS mailserver
  • google email: that is the login for gapps. It is derived from the mailPrimaryAddress but the domain can be different, because its domain must be the one registered with google.

Four different purposes → four different fields.

[quote=“sccmrb, post:1, topic:5669”]And I should be able to CSV import to any of them.
You can - see above.

Daniel Tröder


So what is the difference in “sourceUID” and “recordUID”. I’m taking Record UID to mean posix UID number like 5828?

When entering usernames I’m being blocked at names with 20 characters. If active directory is capable of supporting 20 characters I NEED to be able to use all 20 and not be artificially limited to 15 which is honestly like going back and using 1990’s technology. Even Apple’s Open Directory didn’t limit me to such draconian name lengths.

You will find out that you will have less duplicates in an organization the longer the username is. I have several people named similarly and going to a first initial last name scheme is 100% unacceptable as it will cause quite a few duplications. Please alter this 15 character nonsense, we’re not going to be using your exam portion anyway.


@sccmrb: Please keep the conversation civil.

I understand that 15 characters can be limiting. But it’s not nonsense. It’s a safety net to not let the exam mode fail badly. Active Directory limits the samAccountName attribute (which is essentially the username) to 20 characters. The exam mode in UCS@school uses temporary users that are created with a prefix to the original username. E.g. if my username is michael, then my exam user will be exam-michael. This prefix can be altered (UCR variable ucsschool/ldap/default/userprefix/exam). Because the default prefix has 5 additional characters, the original username in UCS@school is limited to 20 minus 5 characters.
So, while this feature is limiting to you, it’s essential to the vast majority of UCS@school customers.

BTW: the OpenLDAP side of UCS has no such limit. But as long as I need to use Active Directory, I also have to accept the limits established by Microsoft.

As a workaround (untested), try altering the UCR variable or try to alter the userPrincipalName in Samba/AD and use this for logging in.


The sourceUID is an identifier for the source database.
The recordUID is an identifier for a user in the source database.
Together they uniquely identify a user in a source database, in case there a multiple source databases.

The import is usually used to automatically update the UCS user database from the export of a school management database. If there are multiple school management databases, the imports will only delete those users the were removed from a source database and leave user imported from another database untouched.


Ok, I’m going to have to dumb UCS@School. If I could have used all 20 characters I’d only have to change 14 accounts and those are hyphenated names which I can live with. But being limited to 15 characters I’d have to change 206 and that is unacceptable as I need Active Directory and OpenLDAP compatibility.

Why is CSV import only limited to UCS@School? This is honestly the only reason I installed that app. Now I’m going to be forced to find a 3rd party solution to import my users or write one myself. I’m not happy.


If you can code, it should be simple to write a CSV reading script, that calls the UDM command line like this:

eval $(ucr shell)

udm users/user create --position "cn=users,$ldap_base" \
  --set username="<column1>" \
  --set firstname="<column2>" \
  --set lastname="<column3>" \
  --set password="<column4>" --set overridePWLength=1 --set overridePWHistory=1 \
  --set mailHomeServer="$(hostname -f)" \
  --set mailPrimaryAddress="<column5>"