Active Directory的LDAP用户移动到不同的OU

编程入门 行业动态 更新时间:2024-10-28 08:16:54
本文介绍了Active Directory的LDAP用户移动到不同的OU - 红宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在与Active Directory集成碰钉子。我需要能够将用户从一个OU到另一个。我使用的净LDAP 0.5.0这是在github主分支源$ C ​​$ C挖了一圈,发现了,你能做到这一点。

I have hit a snag in my integration with Active Directory. I need to be able to move users from one OU to another. I'm using net-ldap 0.5.0 which is on github master branch and dug around in the source code and found out you could do this

$ldap.rename( olddn: "cn=bradford ricechip,ou=agents,ou=ihs,ou=test environment,dc=ctatechs,dc=com", newrdn: "cn=bradford ricechip", new_superior: "ou=coach,ou=ihs,ou=test environment,dc=ctatechs,dc=com" )

我收到:#< OpenStruct code = 53,ERROR_MESSAGE =00000057:LdapErr:DSID-0C090A95,注释:旧RDN必须被删除,数据0,v1772 \ X00 matched_dn =,消息=不愿履行> 。我想我不明白我怎么可以删除然后将旧RDN用户移动到一个新的OU。

I'm getting: #<OpenStruct code=53, error_message="00000057: LdapErr: DSID-0C090A95, comment: Old RDN must be deleted, data 0, v1772\x00", matched_dn="", message="Unwilling to perform"> . I guess I don't understand how I can delete the old RDN then move the user to a new OU.

这是我遇到的唯一问题。如果我需要提供别的只是让我知道。在此先感谢所有帮助!

This is the only issue I'm having. If I need to provide anything else just let me know. Thanks in advance for all of the help!

推荐答案

这是我们如何解决它:

@ldap.rename(olddn: user.dn, newrdn: "CN=#{user}", delete_attributes: true, new_superior: "#{new_ou}")

我们还使用LDAP的红宝石版本Github上没有版本的RubyGems。

We also used the version of ldap-ruby on Github not the version on RubyGems.

更多推荐

Active Directory的LDAP用户移动到不同的OU

本文发布于:2023-11-09 03:22:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571259.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:用户   Directory   Active   OU   LDAP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!