mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
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>
This commit is contained in:
parent
179bf9b51c
commit
fc26e29f8e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user