如何使用ldapadd替换LDAP / AD中的accountExpires?

时间:2010-12-01 08:37:14

标签: active-directory ldap

我的ldif文件是:

dn: CN=Test Person,OU=foo,DC=bar,DC=oof,DC=rab,DC=de
changetype: modify
replace: accountExpires
accountExpires: 9223372036854775808

输出:

root@comp:~# ldapadd -h host -f test.ldif
SASL/GSSAPI authentication started
SASL username: [...]
SASL SSF: 56
SASL installing layers
modifying entry "CN=Test Person,OU=foo,DC=bar,DC=oof,DC=rab,DC=de"
ldapadd: Invalid syntax (21)
additional info: 00000057: LdapErr: DSID-0C090B7C, comment: Error in attribute conversion operation, data 0, v1db0

我做错了什么?错误的语法在哪里?

所有其他的东西,如DN,连接,主机等等都会被检查并且没问题。

感谢您的回答!

1 个答案:

答案 0 :(得分:0)

似乎我通过了最大值(在创建用户时由AD设置为默认值),因为这确实有效:

dn: CN=Test Person,OU=foo,DC=bar,DC=oof,DC=rab,DC=de
changetype: modify
replace: accountExpires
accountExpires: 9223372036854775807

(......顺便说一下:它是Long.MAX_VALUE)。在我的测试中增加这个的坏主意...