What is the difference between LoginTime and LastLoginTime User attributes?

  • 7023536
  • 21-Nov-2018
  • 21-Nov-2018

Environment

eDirectory
LDAP

Situation

  • What is the difference between LoginTime and LastLoginTime User attributes?
  • iMonitor shows both Login Time and Last Login Time; e.g.
  • ldapsearch shows LoginTime and an additional Operational Attribute, LastLoginTime; e.g.
    • # ldapsearch -H ldaps://red.lab.services.microfocus.com:636 -x -D "cn=admin,o=Lab" -w password -b "cn=Alice,ou=Users,o=Lab" -s sub -a always "(objectClass=User)" "LoginTime" 
# extended LDIF
#
# LDAPv3
# base <cn=Alice,ou=Users,o=Lab> with scope subtree
# filter: (objectClass=User)
# requesting: LoginTime 
#

# Alice, Users, Lab
dn: cn=Alice,ou=Users,o=Lab
LoginTime: 20181121112751Z

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1
    • # ldapsearch -H ldaps://red.lab.services.microfocus.com:636 -x -D "cn=admin,o=Lab" -w password -b "cn=Alice,ou=Users,o=Lab" -s sub -a always "(objectClass=User)" "LastLoginTime" 
# extended LDIF
#
# LDAPv3
# base <cn=Alice,ou=Users,o=Lab> with scope subtree
# filter: (objectClass=User)
# requesting: LastLoginTime 
#

# Alice, Users, Lab
dn: cn=Alice,ou=Users,o=Lab
LastLoginTime: 20170801103258Z

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

Resolution

  • LoginTime shows the most recent time the user logged in
  • LastLoginTime shows the previous time the user logged in (i.e. The most recent time before LoginTime)

Additional Information

ice can be used on eDirectory servers instead of ldapsearch if required; e.g.
  • # ice -lice.log -v -SLDAP -s"red.lab.services.microfocus.com" -p636 -d"cn=admin,o=Lab" -L"/etc/opt/novell/certs/SSCert.der" -w"password" -b"cn=Alice,ou=Users,o=Lab" -csub -F"objectclass=User" -a"LoginTime" -DLDIF
NetIQ Import Convert Export utility for NetIQ eDirectory 
version: 20812.00e
Copyright (c) 2013 NetIQ Corporation and its affiliates. All Rights Reserved. U.S. Patent No. 6,915,287.
Source Handler: ICE LDAP handler for NetIQ eDirectory (version: 20812.00e)
Destination Handler: ICE LDIF handler for NetIQ eDirectory (version: 20812.00e)
ICE log file: ice.log
Start time: Wed Nov 21 12:22:06 2018

Press control-C to exit
Operation in progress ... 

#This LDIF file was generated by NetIQ's ICE and the LDIF destination handler.
version: 1

dn: cn=Alice,ou=Users,o=Lab
changetype: add
LoginTime: 20181121112751Z
  • # ice -lice.log -v -SLDAP -s"red.lab.services.microfocus.com" -p636 -d"cn=admin,o=Lab" -L"/etc/opt/novell/certs/SSCert.der" -w"password" -b"cn=Alice,ou=Users,o=Lab" -csub -F"objectclass=User" -a"LastLoginTime" -DLDIF
NetIQ Import Convert Export utility for NetIQ eDirectory 
version: 20812.00e
Copyright (c) 2013 NetIQ Corporation and its affiliates. All Rights Reserved. U.S. Patent No. 6,915,287.
Source Handler: ICE LDAP handler for NetIQ eDirectory (version: 20812.00e)
Destination Handler: ICE LDIF handler for NetIQ eDirectory (version: 20812.00e)
ICE log file: ice.log
Start time: Wed Nov 21 12:22:10 2018

Press control-C to exit
Operation in progress ... 

#This LDIF file was generated by NetIQ's ICE and the LDIF destination handler.
version: 1

dn: cn=Alice,ou=Users,o=Lab
changetype: add
LastLoginTime: 20170801103258Z