How to Find Workspaces with No User Connections in 30 Days?

0
15
Asked By CloudJumper93 On

I'm new to AWS and trying to manage around 700 always-on workspaces that our users connect to as their desktop. I believe there are over 100 workspaces that haven't been logged into in the last 30 days. I have access to the workspaces node and CloudWatch, but the Active Directory attribute for last login seems unreliable because I think a service account connects periodically. I'm looking for a straightforward way to generate a list of machines where no users have connected in the past 30 days. I've been attempting to query when UserConnected=0 for more than 30 days, but I'm repeatedly hitting the 500 metric limit. From the workspaces node, I'm particularly interested in the "User last active" field. In a Windows/PowerShell environment, I would simply iterate and dump the computer name and last active user, but I need to find an equivalent solution here. It seems like generating such a report should be common, so any advice would be appreciated. Thanks!

5 Answers

Answered By RMMFan123 On

We extract this data through our Remote Monitoring and Management (RMM) system. It's usually a straightforward process, but I understand that might not be an option for everyone.

Answered By TechGuru99 On

You can check the "last active" info for workspaces through your development portal, which should bypass that metric limit. There are also open-source tools available, like Backstage, but you'd need a decent-sized team to make it functional.

Answered By ScriptingSavvy88 On

You could consider using a cloud shell script to automate the process. I did that recently and it allows you to either export data as a CSV or even directly stop/terminate the workspaces if needed.

Answered By DataNinja77 On

I brute-forced a solution that works well enough. Here's a walkthrough:

1. Log into CloudWatch.
2. Go to the Metrics tab, select All Metrics.
3. Browse to Workspaces and then By Workspace ID.
4. Search for "userconnected" and add it as a filter.
5. Set the time range to Last 4 Weeks and switch the graph view to Data Table.
6. Change Statistic to Maximum and Period to 1 Day.
7. Since this metric is binary, a '1' means there's been at least one connection that day.
8. Use the Actions menu to export to CSV, repeating to get all rows.
9. Combine the CSV files and create your own MAX() row to see if any connections occurred in that window.
10. Relax with a drink after all that work!

Answered By AuthExpert44 On

If your workspaces use SAML authentication, pulling logs from your Identity Provider (IDP) can help you figure out when each user last signed into their workspace. That might give you the insight you need.

CloudJumper93 -

Thanks for the tip! Unfortunately, we're a small organization without the luxury of a big team or advanced tools.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.