Computer is not synchronized due to Object class violation

It might happen that a computer object is not synchronized from Samba 4 / Active Directrory to OpenLDAP. Thus, the client does not work completely for example the GPO could not be evaluated by the client or the computer lost its trust relationship.

This can have different causes. The log file /var/log/univention/connector-s4.log should be checked.

File “/usr/lib/python2.6/dist-packages/ldap/ldapobject.py”, line 426, in result2
res_type, res_data, res_msgid, srv_ctrls = self.result3(msgid,all,timeout)
File “/usr/lib/python2.6/dist-packages/ldap/ldapobject.py”, line 432, in result3
ldap_result = self._ldap_call(self._l.result3,msgid,all,timeout)
File “/usr/lib/python2.6/dist-packages/ldap/ldapobject.py”, line 96, in _ldap_call
result = func(*args,**kwargs)
OBJECT_CLASS_VIOLATION: {‘info’: “attribute ‘shadowLastChange’ not allowed”, ‘desc’: ‘Object class violation’}

If the traceback above is listed for the computer object, please download the script kerberize_from_samba4.py, execute the script and insert the username and a password of a Domain Admin account, for example:

python ./kerberize_from_samba4
Username: Administrator
Password:

Afterwards, the Kerberos attributes are copied from the Samba 4 / Active Directory the corresponding objects OpenLDAP computer accounts and the synchronization will be continue.

Backroudinformation due to replacement of old wiki pages:

univention-ldapsearch uid=‘termfix4$’

Das Auslesen von Passwort-Hashes geht so:

ldbsearch -H ldapi:///var/lib/samba/private/ldap_priv/ldapi
sAMAccountName=‘termfix4$’
unicodePwd supplementalCredentials msds-keyversionnumber

Fix the missing shadowAccount objectClass:

eval “$(ucr shell)”
ldapmodify -D “cn=admin,$ldap_base” -y /etc/ldap.secret <<-%EOR
dn: cn=tauchfix,cn=computers,dc=schein,dc=de
changetype: modify
add: objectClass
objectClass: shadowAccount
%EOR

Check:

ldbmodify -H /var/lib/samba/private/sam.ldb <<-%EOR
dn: CN=termfix4,CN=Computers,DC=schein,DC=de
changetype: modify
add: description
description: test1
%EOR

ldbmodify -H /var/lib/samba/private/sam.ldb <<-%EOR
dn: CN=termfix4,CN=Computers,DC=schein,DC=de
changetype: modify
delete: description
%EOR

sleep 15

eval “$(ucr shell)” univention-ldapsearch uid=‘termfix4$’
ldbsearch -H ldapi:///var/lib/samba/private/ldap_priv/ldapi \ sAMAccountName=‘termfix4$’ \ unicodePwd supplementalCredentials msds-keyversionnumber ‘*’

Mastodon