📅  最后修改于: 2022-03-11 14:47:10.026000             🧑  作者: Mango
from pyad import *
pyad.set_defaults(ldap_server="IT-LHQ-DC1.LIFEALIKE.LAB", username="administrator", password="password")
ou = pyad.adcontainer.ADContainer.from_dn("ou=All_Users, dc=LIFEALIKE, dc=LAB")
new_user = pyad.aduser.ADUser.create("test.02", ou, password="password")