pyad icon indicating copy to clipboard operation
pyad copied to clipboard

Unable to move/rename Users

Open HIILOVEYOUMAN opened this issue 8 years ago • 2 comments

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 avatar Oct 10 '16 19:10 HIILOVEYOUMAN

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.

HIILOVEYOUMAN avatar Oct 10 '16 20:10 HIILOVEYOUMAN

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.

Kipjr avatar Aug 03 '17 07:08 Kipjr