I am trying to create 100 000 users in Active Directory with different attributes. I am trying this with pyad module as shown below:
from pyad import *
user = aduser.ADUser.from_cn("test")
pyad.set_defaults(ldap_server="blr.test.local", username="Administrator", password="test@123")
ou = ADContainer.from_dn("ou=users, dc=test, dc=local")
new_user = ADUser.create("ADUSER123123", ou, password="Secret123")
But I am getting below error:
C:\Users\Administrator\Desktop>python ad_create_user.py
Traceback (most recent call last):
File "ad_create_user.py", line 6, in <module>
ou = ADContainer.from_dn("ou=users, dc=test, dc=local")
NameError: name 'ADContainer' is not defined
C:\Users\Administrator\Desktop>
I have installed pyad module. And I am trying this in Windows server 2008 R2.