How-to: UCS@School - Organisational Unit extended attribute for school

How to:

The UMC modules for domain management enable comprehensive management of a domain’s data. Extended attributes offer the possibility of integrating new attributes into the domain administration that are not covered by the UCS standard scope. Extended attributes are also used by third-party providers for the integration of solutions in UCS.

Hint

An extended attribute can also be created in a non-UCS school environment, I implemented it in this environment by request.

More informations: 4.8. Erweiterung von UMC-Modulen mit erweiterten Attributen — Univention Corporate Server - Handbuch für Benutzer und Administratoren

Step 1: Create new custom attribute

You could create new custom attribute in the following path:
LDAP-Directory/univention/custom attributes

Screenshot from 2024-05-10 16-35-25

Step 2: Choose the Type

Choose the Type Settings: Extended attribute
Screenshot from 2024-05-10 16-36-23

Step 3: Add your settings for the attribute

You have to add your settings in the tab General. In my example i create a location attribute.
Screenshot from 2024-05-10 16-40-22

Step 4: Set the right Module

In my example i will create an attribute to set a value for the location for each OU.
Screenshot from 2024-05-10 16-40-29

Step 5: Set the LDAP mapping

You have to set the LDAP object class and attribute to univentionFreeAttributes and univentionFreeAttribute

Hint

It is possible to set up to 20 univentionFreeAttributes. Make sure that the selected attribute is not in use, otherwise there will be a conflict in the LDAP.

Screenshot from 2024-05-10 17-08-27

Step 6: Set the tab layout

In my example i set the tab layout to Location. This creates a new tab with the name, which can then be found under the settings of the respective OU.
Screenshot from 2024-05-10 17-13-40

Step 7: Set the syntax class

In my example i just want to set an value for the location, so i used the syntax string. I prefer to set the option Editable after creation to make this attribute more customizable.

Save everything and create the attribute with that.
Screenshot from 2024-05-10 16-40-51

Step 8: Select and edit an OU

Now select an OU in the LDAP directory, highlight it, and right-click to select Edit.
You will now see a new tab with the name Location and can set a value.
This allows you to use your extended attribute on the OU.
Screenshot from 2024-05-10 17-31-43

udm container/ou list --filter ou=mejneschool2

ou=mejneschool2
DN: ou=mejneschool2,dc=ucs5schoolhejne,dc=intranet
  Location: Bremen
  computerPath: 0
  description: None
  dhcpPath: 0
  displayName: mejneschool2
  dnsPath: 0
  domaincontrollerPath: 0
  entryUUID: b08fc31a-92a7-103e-9f18-d3f8a75964de
  gPLink: None
  groupPath: 0
  licensePath: 0
  mailPath: 0
  modifyTimestamp: 20240510152713Z
  name: mejneschool2
  networkPath: 0
  policyPath: 0
  printerPath: 0
  sharePath: 0
  ucsschoolClassShareFileServer: cn=mejneschool2,cn=dc,cn=server,cn=computers,ou=mejneschool2,dc=ucs5schoolhejne,dc=intranet
  ucsschoolHomeShareFileServer: cn=mejneschool2,cn=dc,cn=server,cn=computers,ou=mejneschool2,dc=ucs5schoolhejne,dc=intranet
  ucsschoolRole: school:school:mejneschool2
  userPath: 0
  univentionPolicyReference: cn=dhcp-dns-clear,cn=policies,ou=mejneschool2,dc=ucs5schoolhejne,dc=intranet
  univentionPolicyReference: cn=ou-default-ucr-policy,cn=policies,ou=mejneschool2,dc=ucs5schoolhejne,dc=intranet

univention-ldapsearch ou=mejneschool2

dn: ou=mejneschool2,dc=ucs5schoolhejne,dc=intranet
ou: mejneschool2
displayName: mejneschool2
ucsschoolRole: school:school:mejneschool2
univentionObjectType: container/ou
ucsschoolHomeShareFileServer: cn=mejneschool2,cn=dc,cn=server,cn=computers,ou=mejneschool2,dc=ucs5schoolhejne,dc=intranet
ucsschoolClassShareFileServer: cn=mejneschool2,cn=dc,cn=server,cn=computers,ou=mejneschool2,dc=ucs5schoolhejne,dc=intranet
univentionPolicyReference: cn=dhcp-dns-clear,cn=policies,ou=mejneschool2,dc=ucs5schoolhejne,dc=intranet
univentionPolicyReference: cn=ou-default-ucr-policy,cn=policies,ou=mejneschool2,dc=ucs5schoolhejne,dc=intranet
univentionFreeAttribute1: Bremen
objectClass: top
objectClass: ucsschoolOrganizationalUnit
objectClass: univentionFreeAttributes
objectClass: univentionPolicyReference
objectClass: organizationalUnit
objectClass: univentionObject

Optional Step 9: Create the extended attribute via udm command

udm settings/extended_attribute create --position "cn=custom attributes,cn=univention,$(ucr get ldap/base)" --set name=Location --set shortDescription=Location --set tabName=Location --set CLIName=Location --set mayChange=1 --set module="container/ou" --set objectClass=univentionFreeAttributes --set ldapMapping=univentionFreeAttribute1 --set syntax=string --set copyable=1 --set deleteObjectClass=1
1 Like
Mastodon