How can I get a list of usernames and their activity times on a remote machine, using C#?
For example, if there is a Windows machine named 'ABC-PC' and there are currently three active users on it named 'X', 'Y' and 'Z'. Where:
- 'X' is currently active
- 'Y' is idle for last 4 minutes
- 'Z' is idle for last 20 minutes
I want to write code that fetches me all of these mentioned information. I am sure there is some .NET API but which one is that I am unsure.