pyad
pyad copied to clipboard
Unable to move/rename Users
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:
Has no one ran into this issue?
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.
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.