How-to: Create custom fields in the UMC with an extended attribute

How to:

It is possible to set values in the UMC for computer accounts to make the differentiation and management more precise. If you want to create your own fields so that they can be used with additional values, you can do this using extended attributes.

Step 1: Create new custom attribute

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

Step 2: Choose the Type

Choose the Type Settings: Extended attribute

Step 3: Add your settings for the attribute

You have to add your settings in the tab General. In my example i create a count attribute.

Step 4: Set the right Module

In my example i will create an attribute to set a value for IP-Client and i choose Computer:IP client.

Step 5: Set the LDAP mapping

You have to set the LDAP object class and attribute to univentionFreeAttributes and univentionFreeAttribute.
If necesarry, you could set the mark for Remove object class if the attribute is removed

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.

Step 6: Settings for UMC and ordering numbers

As we want to add a new field for the computer account, we need to define this in the Group layout and set the group name and group ordering number to group name=Computer account, because we want the new field in this tab.

Set both ordering number and group ordering number to the same value, so you can prevent possible errors.

It’s very important to translate the entries correctly, otherwise the attribute will not work as expected.

Step 7: Configure the data type

In my example i just want to set any value, 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.

Step 8: Check the new field

From now on you can use the new field and the extended attribute as you need.


UDM-CLI way

Of course, it is possible to create the entire extended attribute from the shell. UDM is best suited for this, and the object could then be created as follows.

udm settings/extended_attribute create --position "cn=custom attributes,cn=univention,$(ucr get ldap/base)" \
--set name=count \
--set CLIName=count \
--set shortDescription="Computer count" \
--set translationShortDescription='"de_DE" "Computer Zahl"' \
--set longDescription="This is a attribute to count the computer objects" \
--set translationLongDescription='"de_DE" "Das ist ein Attribute um die Anzahl der Computerobjekte zu bestimmen"' \
--set module="computers/ipmanagedclient" \
--set objectClass=univentionFreeAttributes \
--set ldapMapping=univentionFreeAttribute5 \
--set tabPosition=5 \
--set tabName=General \
--set translationTabName="de_DE Allgemein" \
--set groupName="Computer account" \
--set translationGroupName='"de_DE" "Rechnerkonto"' \
--set groupPosition=5 \
--set syntax=string \
--set valueRequired=0 \
--set mayChange=1 \
--set copyable=1 \
--set deleteObjectClass=1
Object created: cn=count,cn=custom attributes,cn=univention,dc=ucs5schoolhejne,dc=intranet

List the extended attribute with all settings.

udm settings/extended_attribute list --filter cn=count

cn=count
DN: cn=count,cn=custom attributes,cn=univention,dc=ucs5schoolhejne,dc=intranet
  CLIName: count
  copyable: 1
  default: None
  deleteObjectClass: 1
  disableUDMWeb: None
  doNotSearch: None
  fullWidth: None
  groupName: Computer account
  groupPosition: 5
  hook: None
  ldapMapping: univentionFreeAttribute5
  longDescription: This is a attribute to count the computer objects
  mayChange: 1
  module: computers/ipmanagedclient
  multivalue: None
  name: count
  notEditable: 0
  objectClass: univentionFreeAttributes
  overwritePosition: None
  overwriteTab: None
  preventUmcDefaultPopup: None
  shortDescription: Computer count
  syntax: string
  tabAdvanced: None
  tabName: General
  tabPosition: 5
  translationGroupName: de_DE: Rechnerkonto
  translationLongDescription: de_DE: Das ist ein Attribute um die Anzahl der Computerobjekte zu bestimmen
  translationShortDescription: de_DE: Computer Zahl
  translationTabName: de_DE: Allgemein
  valueRequired: 0
  version: 2