summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/netcmd/common.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/netcmd/common.py b/source4/scripting/python/samba/netcmd/common.py
index cc97fc523f..9291f872ab 100644
--- a/source4/scripting/python/samba/netcmd/common.py
+++ b/source4/scripting/python/samba/netcmd/common.py
@@ -62,3 +62,12 @@ def netcmd_finddc(lp, creds, realm=None):
cldap_ret = net.finddc(domain=realm,
flags=nbt.NBT_SERVER_LDAP | nbt.NBT_SERVER_DS | nbt.NBT_SERVER_WRITABLE)
return cldap_ret.pdc_dns_name
+
+
+def netcmd_get_domain_infos_via_cldap(lp, creds, address=None):
+ '''Return domain informations (CLDAP record) of the ldap-capable
+ DC with the specified address'''
+ net = Net(creds=creds, lp=lp)
+ cldap_ret = net.finddc(address=address,
+ flags=nbt.NBT_SERVER_LDAP | nbt.NBT_SERVER_DS)
+ return cldap_ret