Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename a group #154

Open
PapaOursNoob opened this issue Feb 21, 2022 · 2 comments
Open

Rename a group #154

PapaOursNoob opened this issue Feb 21, 2022 · 2 comments

Comments

@PapaOursNoob
Copy link

Hello,

I am trying to rename a global security group.
It partially works.
The Samaccountname isn't modified, the CN is.

And I always have an error :

Traceback (most recent call last):
File "E:\Poste de travail local\Script\Python\AD-admin.py", line 116, in
GroupAD.rename("Renommage",False)
File "C:\Program Files\Python310\lib\site-packages\pyad-0.5.20-py3.10.egg\pyad\adobject.py", line 460, in rename
File "C:\Program Files\Python310\lib\site-packages\pyad-0.5.20-py3.10.egg\pyad\adobject.py", line 226, in __set_gc_adsi_obj
File "<COMObject >", line 2, in OpenDSObject
pywintypes.com_error: (-2147352567, 'Une exception s’est produite.', (0, 'Active Directory', 'Cet objet ne se trouve pas sur le serveur.\r\n', None, 0, -2147016656), None)

it seems like the object can't be found juste after it is renamed.

I have a workaround for the Samaccountname.
Do you have any idea why it is bahaving this way ?

@PapaOursNoob
Copy link
Author

I think, there is a problem with distinguished name that doesn't exist in a group

@PapaOursNoob
Copy link
Author

I found the problem :
Line 455
self.__distinguishedName = self.get_attribute('distinguishedName', False)
instead of
self.__distinguished_name = self.get_attribute('distinguishedName', False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant