简体   繁体   English

Sun Directory Server的ldap_rename的替代方法

[英]Alternative to ldap_rename for Sun Directory Servers

PHP provides a great function for copying or moving directory records within LDAP. PHP提供了一个很棒的功能,用于在LDAP中复制或移动目录记录。 Unfortunately this ldap_rename function doesn't seem to work on the Sun Directory . 不幸的是,这个ldap_rename函数在Sun目录上似乎不起作用 Do any alternatives exist to change an account's OU without having to create a new account? 是否有其他替代方法可以更改帐户的OU,而无需创建新帐户?

My end goal is to have a simple method to switch between two OU's, such as: CN=username,OU=Admin,DC=uaa,DC=alaska,DC=edu to 我的最终目标是要有一个简单的方法来在两个OU之间切换,例如: CN=username,OU=Admin,DC=uaa,DC=alaska,DC=edu
CN=username,OU=Student,DC=uaa,DC=alaska,DC=edu

You can do it with LDIF. 您可以使用LDIF。 On the directory point of view, the job you want to do is called a DN modification, there are two LDAP verbs for that moddn and modrdn . 从目录的角度来看,您要执行的工作称为DN修改,该moddnmodrdn有两个LDAP动词。

It can be done in LDIF by this way in OpenLDAP: 可以通过LDIF在OpenLDAP中通过以下方式完成:

dn: CN=username,OU=Admin,DC=uaa,DC=alaska,DC=edu
changetype: modrdn
newrdn: CN=username
deleteoldrdn: 0
newsuperior: OU=Student,DC=uaa,DC=alaska,DC=edu

I use this way accros Active Directory : 我使用这种方式对Active Directory进行累计:

dn: CN=username,OU=Admin,DC=uaa,DC=alaska,DC=edu
Changetype: moddn
Newrdn: CN=username
Deleteoldrdn: 1
Newsuperior: OU=Student,DC=uaa,DC=alaska,DC=edu

Be careful , copy/delete is significantly different from moddn and modrdn in the first solution you create new objects (new guid or uuid in the LDAP database) and it can impact replication. 请注意 ,在创建新对象(LDAP数据库中的新guiduuid )的第一个解决方案中, 复制/删除moddnmodrdn显着不同,它可能会影响复制。 In the second solution you move objects. 在第二个解决方案中,您移动对象。

Perhaps you can find there verbs in PHP. 也许您可以在PHP中找到动词。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM