zakird / pyad

Python Active Directory Tools | *Not actively maintained*
http://zakird.github.io/pyad/
176 stars 72 forks source link

Unable to move/rename Users #61

Open HIILOVEYOUMAN opened 8 years ago

HIILOVEYOUMAN commented 8 years ago

So i've set the defaults to the remote server and with the administrator username and password. pyad.set_defaults(ldap_server="[server_ip]", username="administrator", password="[admin_password")

then i query the user and the container i want to move the user to: user = pyad.aduser.ADUser.from_dn("cn= Test Category2Renamed, ou=[censored], ou=[censored], ou=[censored], dc=[censored], dc=[censored]") ou = pyad.adcontainer.ADContainer.from_dn("ou=[censored], ou=[censored], ou=[censored], dc=[censored], dc=[censored]")

these all worked perfectly, but the moment i run: user.move(ou) or user.rename('renamed')

I always get this error: error

Has no one ran into this issue?

HIILOVEYOUMAN commented 8 years ago

After looking closer at the code, it seems to be the authentication from __set_gc_adsi_obj. I'm fairly new to AD so if someone could point me in the right direction that would be much appreciated.

Kipjr commented 7 years ago

By default, pyad will connect to the Active Directory domain to which the machine is joined (rootDSE):

comment out "pyad.set_defaults(ldap_server="[server_ip]", username="administrator", password="[admin_password")" and try again.

I never needed to authenticate myself, unless you're not working on the server.