BFLCM-I-312: Return operator creation date in REST API

We have a scheduled script that removes operators if their LastLoginTime is greater than 90 days. However, we run into an issue when an operator has never signed in, since their LastLoginTime is set to “Thu, 01 Jan 1970 00:00:01 +0000” by default.

We can ignore operators with “Thu, 01 Jan 1970 00:00:01 +0000” as the LastLoginTime, but we do want to remove these accounts after 90 days as well. Being able to retrieve the creation date would allow us to do a check and make sure an operator with a >90 day old LastLoginTime is not also a brand new account.

I can see how this field would be valuable to include the output of /api/operator/{operator name} (thank you for the idea submission!).

That said, as a potential workaround, you can return the operator’s creation date via Session Relevance through /api/query.

Here’s some sample session relevance (which can of course be adapted with filters, or more fields as needed):

(name of it, creation time of it, last login time of it as string | "n/a") of bes users

And here’s a sample REST API call with the above:

https://<bigfix server:port>/api/query?output=json&relevance=%28name%20of%20it%2C%20creation%20time%20of%20it%2C%20last%20login%20time%20of%20it%20as%20string%20%7C%20%22n%2Fa%22%29%20of%20bes%20users

3 Likes

That’s a perfect workaround, thank you! I’ve added it to our user cleanup script and it’s working just fine. Thanks again.

1 Like