Menu

KeePass KPScript GetEntryString and Expire flag

Help
2015-10-05
2023-08-17
  • Tammy Osborn

    Tammy Osborn - 2015-10-05

    I'm trying to invoke KPScript.exe (v2.29) with the -c:GetEntryString command to get an entry specified by it's Username. I want to exclude expired entries.

    But using -ref-Expires:False doesn't work. Is it possible to include a check of the Expired flag like I am doing?

    KPScript -c:GetEntryString "mydb.kdbx" -pw:xxxx -Field:Password -ref-UserName:xxx -ref-Expires:False

     

    Last edit: Tammy Osborn 2015-10-05
  • wellread1

    wellread1 - 2015-10-05

    It appears the -ref-Expires does not work. It may be that the "Expires" property is not considered a field.

    Note that suppling "Expires" as the argument for the -Field: parameter does not return value of the Expires "field" either e.g.:

    KPSCRIPT.exe -c:GetEntryString "newdatabase.kdbx" -pw:test -Field:Expires -refx-All

     

    Last edit: wellread1 2015-10-05
  • Tammy Osborn

    Tammy Osborn - 2015-10-09

    Agree. It seems to me this would be desirable in the next version for KPScript. Having a way to programatically get an entry that is NOT expired would benefit a lot of people. How can I get this on the list for consideration?

     
  • wellread1

    wellread1 - 2015-10-10

    You can post a feature request.

     
  • Dominik Reichl

    Dominik Reichl - 2015-10-17

    Indeed, the expiry info (checkbox and date/time) is not a string field.

    I've now added two command line parameters for KPScript:
    -refx-Expires: can be set to true or false. This parameter allows to specify whether the entry expires sometime (i.e. whether the 'Expires' checkbox is checked, independent of the expiry time).
    -refx-Expired: can be set to true or false. This parameter allows to specify whether the entry has expired (i.e. whether the 'Expires' checkbox is checked and the expiry time is not in the future).

    Here's the latest KPScript development snapshot for testing:
    http://keepass.info/filepool/KPScript_151017.zip

    Thanks and best regards,
    Dominik

     

    Last edit: Dominik Reichl 2015-10-17
  • Robert

    Robert - 2023-08-10

    Hi

    Then how do i check the datetime? is there now way to get this value?
    Id like to perform a check on upcoming expirations e.g before it happens and notify about this.

    /Robert

     
  • Paul

    Paul - 2023-08-11

    Expiry time can be returned and you can then test it externally. There isn't an internal time calculation.
    You can list entries using "-refx-Expires:True" KeePass returns a "TE" field. This also returns the password - not good.
    You can't return "TimeExpires" with GetEntryString (Dominik, can we have one please?).

    cheers, Paul

     
  • Robert

    Robert - 2023-08-11

    Hi
    Thanks Paul

    Yes that is not very good and also the date and time stamp dosen't match.
    My Entry expired 2023-08-10 00:00:00 but the ListEntries gave me the following:

    TC: 2023-08-03T13:52:42Z
    TLM: 2023-08-10T11:35:20Z
    TE: 2023-08-09T22:00:00Z

    TLM is the only one that is a close match (except the time) i would guess TE stands for Time Edited and TC is Time Created. what does TLM stand for?

    I second pauls requst (and others) of having TimeExpires available available through GetEntryString command. It would simplify extracting this information rather than go through the entire entry.

    /Regards Robert

     
  • Dominik Reichl

    Dominik Reichl - 2023-08-11

    If your goal is to see entries that will expire soon, why don't you use one of the commands in the menu 'Find' → 'Expiring In'? Expired entries and entries that will expire soon can also be shown automatically when opening a database (options in 'Tools' → 'Options' → tab 'Advanced').

    The expiry time is not an entry string. However, I could imagine adding another command (or a parameter) for this in a future version.

    TC = creation time, TLM = last modification time, TE = expiry time. All times are in UTC (as indicated by the 'Z').

    Best regards,
    Dominik

     
  • Robert

    Robert - 2023-08-11

    Ahh timezone messed me up. it is TE that is TimeExpires. since i had the time 00:00:00 in Ui the command gave me TE: 2023-08-09T22:00:00Z e.g my time -2 hours.

    /Robert

     
  • Robert

    Robert - 2023-08-17

    Hi Dominik

    The purpose here is to send notification to responsible person without them needing to do a manual check. It would greatly simplify if i could List entries that has expires checked and iterating the UUID and get the values i need by the GetEntryString. Do a check on date and send a notification based on extracted valuse.

    Now i have to get the list and extract the values (TE & UUID) from the output by Select-string -pattern and from that i get two strings that i have to iterate over in sync(somehow) and check date and get the values i need etc.

    It would be much appreciated with a way to get the datetime values. Thanks! :)
    /Robert

     

Log in to post a comment.