def enum_ou(self, ou): ou.ad_id = self.ad_id self.session.add(ou) self.session.commit() self.session.refresh(ou) if ou.gPLink is not None and ou.gPLink != 'None': for x in ou.gPLink.split(']'): if x is None or x == 'None': continue x = x.strip() if x == '': continue gp, order = x[1:].split(';') gp = re.search(r'{(.*?)}', gp).group(1) gp = '{' + gp + '}' link = JackDawADGplink() link.ent_id = ou.id link.gpo_dn = gp link.order = order self.session.add(link) self.session.commit() self.sd_ctr += 1 job = LDAPAgentJob(LDAPAgentCommand.SDS, { 'dn': ou.dn, 'obj_type': 'ou' }) self.agent_in_q.put(job)
def store_ous(self, ou): ou.ad_id = self.ad_id self.session.add(ou) self.session.commit() self.session.refresh(ou) if ou.gPLink is not None and ou.gPLink != 'None': for x in ou.gPLink.split(']'): if x is None or x == 'None': continue x = x.strip() if x == '': continue gp, order = x[1:].split(';') gp = re.search(r'{(.*?)}', gp).group(1) gp = '{' + gp + '}' link = JackDawADGplink() link.ent_id = ou.id link.gpo_dn = gp link.order = order self.session.add(link) self.session.flush()