lastLogonTimestamp
有没有人使用 Java 程序在 Active Directory 中设置值?
我发现以下转换lastLogonTimestamp
为java.util.Date
格式:
https://forums.oracle.com/message/10133757#10133757
使用相同的逻辑,我正在尝试修改此属性的值:
long llastLogonAdjust=11644473600000L;
long currentTime = System.currentTimeMillis();
long currentTimeAD = currentTime * 10000-llastLogonAdjust;
System.out.println(currentTimeAD);
ModificationItem[] mods = new ModificationItem[1];
mods[0]= new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute("lastLogonTimestamp", Long.toString(currentTimeAD)));
ldapContext.modifyAttributes(dn, mods);
但是我收到以下错误:
javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 0000209A: SvcErr: DSID-031A0DD5, problem 5003 (WILL_NOT_PERFORM), data 0
任何想法,如何解决它?