This is simply for my personal reference since I keep searching for this. I usually use to check from AWS Systems Manager Session Manager.
The answer is to run the command query user /server:$SERVER
.
The answer is from this StackOverflow question.