MCPcopy Index your code
hub / github.com/XiaoliChan/LDAPShell / get_dn

Method get_dn

utils/ldap_shell.py:612–620  ·  view source on GitHub ↗
(self, sam_name)

Source from the content-addressed store, hash-verified

610 print("---")
611
612 def get_dn(self, sam_name):
613 if "," in sam_name:
614 return sam_name
615
616 try:
617 self.client.search(self.domain_dumper.root, '(sAMAccountName=%s)' % escape_filter_chars(sam_name), attributes=['objectSid'])
618 return self.client.entries[0].entry_dn
619 except IndexError:
620 return None
621
622 def do_exit(self, line):
623 return True

Callers 4

do_add_user_to_groupMethod · 0.95
do_change_passwordMethod · 0.95
do_get_user_groupsMethod · 0.95
do_get_group_usersMethod · 0.95

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected