diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-11-22 22:26:38 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-11-27 12:50:06 +0100 |
commit | fc26e29f8ed1cad0875801782178696ce5f9d1f1 (patch) | |
tree | c9c0b09f12e94075324c747072dcfc67bbe4674c | |
parent | 179bf9b51c9de5f9f8e78893bd20b9821e39e7e4 (diff) | |
download | samba-fc26e29f8ed1cad0875801782178696ce5f9d1f1.tar.gz samba-fc26e29f8ed1cad0875801782178696ce5f9d1f1.tar.bz2 samba-fc26e29f8ed1cad0875801782178696ce5f9d1f1.zip |
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 <metze@samba.org>
-rw-r--r-- | source4/scripting/python/samba/netcmd/common.py | 9 |
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 |