Index: modules/univention/admin/handlers/computers/windows.py =================================================================== --- modules/univention/admin/handlers/computers/windows.py (Revision 73053) +++ modules/univention/admin/handlers/computers/windows.py (Arbeitskopie) @@ -457,9 +457,12 @@ if 'samba' in self.options: acctFlags=univention.admin.samba.acctFlags(flags={'W':1}) if self.s4connector_present: - # In this case Samba 4 must create the SID, the s4 connector will sync the - # new sambaSID back from Samba 4. - self.machineSid='S-1-4-%s' % self.uidNum + if hasattr(self, 'sambaRID') and self.info['sambaRID']: + self.machineSid = self.getMachineSid(self.lo, self.position, self.uidNum, self.get('sambaRID')) + else: + # In this case Samba 4 must create the SID, the s4 connector will sync the + # new sambaSID back from Samba 4. + self.machineSid='S-1-4-%s' % self.uidNum else: self.machineSid = self.getMachineSid(self.lo, self.position, self.uidNum, self.get('sambaRID')) self.alloc.append(('sid',self.machineSid))