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?
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
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?
You can post a feature request.
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
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
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
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
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
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
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