I was wondering if there is a way to find out what users have logged into Octopus Deploy in the last 3 months. I am able get a list of users in Octopus by using an REST API call: Invoke-RestMethod "$OctopusUrl/api/users?take=500" -Headers $header. I cant see an API call to get user login activity. Just want to ask if anyone knows a way to do this?
I can potentially see two ways of doing this
1) Use the api/events
endpoint. This will allow you to provide a range of dates using the from
and to
parameters. You would then have to enumerate all records and pull out the distinct users you come across - you probably want to narrow this by ensuring the account authenticated with a cookie "IdentityEstablishedWith": "Session cookie"
2) Use the results from the api/users
to call the api/events
endpoint, with the date range and the specific user e.g. ?users=Users-1
. Here, you only need to check if you get more than 1 result with the "IdentityEstablishedWith": "Session cookie"
field set correctly
Hope this helps