Univention Directory Reports Syntax

Hi,

I created a new report which exports all users in a certain order. It mostly works well.
But there are two problems I’m struggling with.

Attributes disabled and locked are either 1 or 0. Is there a way to change these values to yes or no directly in the template?

Also I would like to export an ou. Our users have the following DN scheme:

uid=user,ou=subdepartment,ou=maindepartment,dc=company,dc=com or
uid=user,ou=maindepartment,dc=company,dc=com

Is there a way to export the value maindepartment?

I didn’t find a solution for it, so I wrote a bash-script which mostly does what I want.

I extract the maindepartment by beginning to count at the end of the string:

string=“uid=user,ou=subdepartment,ou=maindepartment,dc=company,dc=com”
ou=echo $string | awk -F"," '{print $(NF-2)}' | awk -F"=" '{print $2}' | tr -d "\n"