Create new organizational unit with pyad

208 Views Asked by At

I'm trying to use PYAD to create a new organizational unit, unfortunately i cannot find any helpful resources to do this online. Does anyone know how to do this?

1

There are 1 best solutions below

0
On

Found it. You can do this with:

dept = dept_entry.get()
ou = pyad.adcontainer.ADContainer.from_dn("ou=depts, dc=acme, dc=local"
pyad.adcontainer.ADContainer.create_container(ou, dept)