powershell - Get list of users who have logged into Octopus in the last 6 months
问题描述
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
推荐阅读
- php - 想在 codeigniter 中使用电子邮件和手机登录
- python - 在代码运行时,在 vs 代码中使用 Python 无法打印到终端
- google-play - 退款的非消耗性购买仍在列表中 Google Play 结算库 2.1.0
- azure - Azure 服务总线上超出了最大传输跃点计数
- python - AD转换为BS
- javascript - 从索引开始查找谓词
- python - Flask URL 不再在 Pycharm Conscole 中打印
- android - LifecycleScope.launch 与 onViewCreated 中的协程
- maven - Artifactory mvn deploy 未授权
- ruby-on-rails - rails服务器启动失败,win10