active directory - updating lastLogonTimestamp using Java code -


did set value of lastlogontimestamp in active directory using java program?

i found following convert lastlogontimestamp java.util.date format:

https://forums.oracle.com/message/10133757#10133757

using same logic, trying modify attribute's value:

    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); 

however getting following error:

javax.naming.operationnotsupportedexception: [ldap: error code 53 - 0000209a: svcerr: dsid-031a0dd5, problem 5003 (will_not_perform), data 0 

any idea, how solve it?

looking @ documentation lastlogontimestamp, system can update value. cannot set value using java or else.

edit:

look @ blog post (internet archive backup) warren williams explanation lastlogontimestamp attribute:

it important note intended purpose of lastlogontimestamp attribute identify inactive computer , user accounts. lastlogon attribute not designed provide real time logon information. default settings in place lastlogontimestamp 9-14 days behind current date.

if looking more “real-time” logon tracking need query security event log on dc’s desired logon events i.e. 528 –windows xp\2003 , earlier or 4624 windows vista\2008 . see blog post (internetarchive) eric fitzgerald more info. (i think knows auditing)

imo best bet near real-time data use event log collection service gather domain controller security event logs centralized database. can query single database desired logon events. microsoft’s solution security event log collection audit collection services. there many 3rd party solutions well.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -