def getAllComputers(self, attrs=''):
if not attrs:
attrs = ['cn', 'dNSHostName', 'operatingSystem', 'operatingSystemVersion', 'operatingSystemServicePack']
objectFilter = '(objectClass=Computer)'
base_dn = self.domainBase
try:
rawComputers = self.do_ldap_query(base_dn, ldap.SCOPE_SUBTREE, objectFilter, attrs)
except LDAPError, e:
print "[!] Error retrieving computers"
print "[!] {}".format(e)
sys.exit(1)
return (self.get_search_results(rawComputers), attrs)
评论列表
文章目录