Search code examples
amazon-web-servicesamazon-ec2amazon-workdocs

How to filter AWS workspaces as per last user activity?


My organisation has 59 AWS workspaces now i have to delete all those which have not been accessed for more than 50 days. Is there a way where I can filter all the workspaces older than 50 days in console.


Solution

  • You can't do this easily. The AWS CLI describe-workspaces-connection-status will return a paginated list, which includes a value for LastKnownUserConnectionTimestamp. But you will have to retrieve all of the values, and then sort them to find any that have not had recent connection attempts. Also keep in mind that if someone remains connected for days or weeks, this value will not update.