Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ldap3 import Server, Connection, ALL
- import getpass
- #admin = input("Please enter your Adminname: ")
- #passwort = getpass.getpass("Please provide your Passwort: ")
- #user = input("Wie lautet der Name des User nach welchem gesucht wird?:(Nachname) ")
- #filterS = search_filter('&(givenName=' + user +'*')
- #search_base = 'dc=ZTG,dc=Users,dc=Employees')
- admin='admin_kamo'
- passwort = '3Ilovefood!3'
- ads_server = Server('kronos.ads.zuehlke.com', use_ssl=True, get_info=ALL)
- connection = Connection(ads_server, user = 'ads\\'+admin ,password=passwort,auto_bind=True)
- #connection.search('DC=ads,DC=zuehlke,DC=com,DC=ZTG,DC=Users,DC=Employees','&(objectclass=person')())
- connection.search('DC=ads,DC=zuehlke,DC=com, ou=ZTG,ou=Users,ou=Employees', '(&(objectclass=person)(sn=moutiq))', attributes=['samAccountName'])
- print(connection.entries)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement