Check connected users

Hello,

I’d like to see if there is a way to check the users that are logged into the data sources without using the get-pwusers command, I meant sql statement.