Problem: UMC Complains About Missing Defaults

python
umc
problem

#1

Problem

Univention Management Console (UMC) complains about missing default values and informs to set them as shown in the following screenshot:
screenshot_2018-11-27_094750

The following empty properties were set to default values in the form. 
These values will be applied when saving.
* Account .....

Solution

Create and execute the following Python script. It will set all empty attributes to the default values

import univention.admin.modules as modules
from univention.admin.uldap import getAdminConnection

FILTER_STRING = ''

modules.update()
lo,po=getAdminConnection()
user_mod = modules.get('users/user')
modules.init(lo,po,user_mod)


users = user_mod.lookup(None, lo, FILTER_STRING)

for user in users:
	user.open()
	print('Setting default values for {}'.format(user['username']))
	user.set_defaults = 1
	user.set_default_values()
	user.modify()

Problem: permissionDenied reject on a school slave