From fc26e29f8ed1cad0875801782178696ce5f9d1f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Matthias=20Dieter=20Walln=C3=B6fer?= Date: Tue, 22 Nov 2011 22:26:38 +0100 Subject: [PATCH] s4:netcmd/common.py: add a "netcmd" function to do a cldap netlogon request This is useful for a new "samba-tool domain info" command. Patch inspired by Matthieu Patou. Signed-off-by: Stefan Metzmacher --- source4/scripting/python/samba/netcmd/common.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source4/scripting/python/samba/netcmd/common.py b/source4/scripting/python/samba/netcmd/common.py index cc97fc523fb..9291f872aba 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 -- 2.11.4.GIT