[python-win32] Adding Users to a Specific Organization Unit in a Domain

Ian John Newton newtonian at tsn.cc
Wed Apr 2 14:51:44 CEST 2008


Hi

I  need to take a text file with a list of users, groups and 
Organization Units and then add these users into a Domain. Currently the 
server is Win 2K, but I will also need to do this on Win2003.

I used the BatchUserCreate.py from ch 16 of Mark Hammonds Python 
Programming on Win32 <http://www.ora.com/catalog/pythonwin32/> and then 
added a win32net.NetGroupAddUser(serverName, group, userName) function 
to add the user to a particular security group. This all works fine.

I can't seem to find a way to change the organizational unit - all users 
get added to the Default container "Users" in the security group Domain 
Users.

Is there any com method to add them to a specific Organizational Unit?

Thanks in advance for any help you may be able to provide.

Regards,

Ian Newton




More information about the python-win32 mailing list