diff -Nuarp src/samba4-4.0.0~beta4/source4/scripting/python/samba/join.py samba4-4.0.0~beta4/source4/scripting/python/samba/join.py --- src/samba4-4.0.0~beta4/source4/scripting/python/samba/join.py 2011-12-13 19:42:56.000000000 +0100 +++ samba4-4.0.0~beta4/source4/scripting/python/samba/join.py 2011-12-23 03:51:11.000000000 +0100 @@ -141,6 +141,14 @@ class dc_join(object): ctx.managedby = None ctx.subdomain = False + ctx.next_rid = None + if ctx.keep_existing: + res = ctx.samdb.search(base=ctx.promote_from_dn, + expression='(&(CN=RID Set)(rIDNextRID=*))', + attrs=["rIDNextRID"]) + if res: + ctx.next_rid = res[0]["rIDNextRID"][0] + def del_noerror(ctx, dn, recursive=False): if recursive: try: @@ -648,6 +656,7 @@ class dc_join(object): schemadn=ctx.schema_dn, configdn=ctx.config_dn, serverdn=ctx.server_dn, domain=ctx.domain_name, hostname=ctx.myname, domainsid=ctx.domsid, + next_rid=ctx.next_rid, machinepass=ctx.acct_pass, serverrole="domain controller", sitename=ctx.site, lp=ctx.lp, ntdsguid=ctx.ntds_guid, use_ntvfs=ctx.use_ntvfs, dns_backend=ctx.dns_backend)