Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Python writes AD department information error "the directory service cannot perform the requested operation on the RDN property of an object"

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today to talk with you about python writing AD department information error "directory service can not perform the operation of the request on the RDN attribute of an object" how to do, many people may not quite understand, in order to let you know more, Xiaobian summed up the following content, I hope you can get something according to this article.

Python reported an error in writing AD department information: "the directory service cannot perform the requested operation on the RDN property of an object" problem:

Today, use Python's third-party library pyad to modify the information of the department (OU) in AD, update the department attribute through ou.update, and want to change the department name (Name). This is an error: "the directory service cannot perform the requested operation on the RDN attribute of an object."

Resolution process:

By looking at the source code of this update, you can write attributes and not write which attributes are writable. Let's see if there are any other methods for the ou object. At this point, we see that there is an ou.rename attribute, which is probably a renamed method, and executes it, which is exactly the same as guessed.

Solution:

When updating the property of OU, execute ou.update (attr= {}), attr is the key-value pair dictionary of the attribute, the key must be the same as the AD attribute, and this property is writable.

When updating the name of OU, execute ou.rename (new_name= "xxxx")

After reading the above, do you have any further understanding of what to do when python writes AD department information that the directory service cannot perform the requested operation on the RDN property of an object? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report