summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-08-08 11:01:21 +0200
committerStefan Metzmacher <metze@samba.org>2011-08-12 12:39:05 +0200
commit5d6b8483943697cc10fe7e42fcf2d544f5758dbc (patch)
tree9d4be534f55c7fa2f9ca5f19575aba5b1d3233ae /source4
parenta3f262182a65de04a41a336c7c08854723879065 (diff)
downloadsamba-5d6b8483943697cc10fe7e42fcf2d544f5758dbc.tar.gz
samba-5d6b8483943697cc10fe7e42fcf2d544f5758dbc.tar.bz2
samba-5d6b8483943697cc10fe7e42fcf2d544f5758dbc.zip
s4:py/samba/join: add domain_critical_only=False to join_DC/join_RODC
metze Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/join.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py
index c24e8d6800..00f2c54211 100644
--- a/source4/scripting/python/samba/join.py
+++ b/source4/scripting/python/samba/join.py
@@ -480,7 +480,7 @@ class dc_join(object):
replica_flags=ctx.replica_flags)
repl.replicate(ctx.base_dn, source_dsa_invocation_id,
destination_dsa_guid, rodc=ctx.RODC,
- replica_flags=ctx.replica_flags)
+ replica_flags=ctx.domain_replica_flags)
if ctx.RODC:
repl.replicate(ctx.acct_dn, source_dsa_invocation_id,
destination_dsa_guid,
@@ -534,7 +534,7 @@ class dc_join(object):
def join_RODC(server=None, creds=None, lp=None, site=None, netbios_name=None,
- targetdir=None, domain=None):
+ targetdir=None, domain=None, domain_critical_only=False):
"""join as a RODC"""
ctx = dc_join(server, creds, lp, site, netbios_name, targetdir, domain)
@@ -569,6 +569,10 @@ def join_RODC(server=None, creds=None, lp=None, site=None, netbios_name=None,
drsuapi.DRSUAPI_DRS_NEVER_SYNCED |
drsuapi.DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING |
drsuapi.DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP)
+ ctx.domain_replica_flags = ctx.replica_flags
+ if domain_critical_only:
+ ctx.domain_replica_flags |= drsuapi.DRSUAPI_DRS_CRITICAL_ONLY
+
ctx.do_join()
@@ -576,7 +580,7 @@ def join_RODC(server=None, creds=None, lp=None, site=None, netbios_name=None,
def join_DC(server=None, creds=None, lp=None, site=None, netbios_name=None,
- targetdir=None, domain=None):
+ targetdir=None, domain=None, domain_critical_only=False):
"""join as a DC"""
ctx = dc_join(server, creds, lp, site, netbios_name, targetdir, domain)
@@ -590,6 +594,9 @@ def join_DC(server=None, creds=None, lp=None, site=None, netbios_name=None,
drsuapi.DRSUAPI_DRS_PER_SYNC |
drsuapi.DRSUAPI_DRS_FULL_SYNC_IN_PROGRESS |
drsuapi.DRSUAPI_DRS_NEVER_SYNCED)
+ ctx.domain_replica_flags = ctx.replica_flags
+ if domain_critical_only:
+ ctx.domain_replica_flags |= drsuapi.DRSUAPI_DRS_CRITICAL_ONLY
ctx.do_join()
print "Joined domain %s (SID %s) as a DC" % (ctx.domain_name, ctx.domsid)