2024-10-01 07:18:39 发布
网友
我试图编写一个python脚本来验证某个特定域中是否存在用户名。在
To query : username -- > anandabhis domain name --> example.com Output : Successfully verified .
为此,我使用PythonLDAP模块连接到ldap服务器。但是,即使在阅读了大量的文档之后,我也无法继续进行下去。在
简单搜索用户的sAMAccountName,就可以获得用户的属性。在
user_filter = '(sAMAccountName={})'.format(search_username) base_dn = 'DC={},DC=com'.format(domain) result = connection.search_s(base_dn, ldap.SCOPE_SUBTREE, user_filter) print result
简单搜索用户的sAMAccountName,就可以获得用户的属性。在
相关问题 更多 >
编程相关推荐