Powershell script to see currently logged in users (domain and machine) + status (active, idle, away)

后端 未结 6 1393
无人及你
无人及你 2020-11-29 22:44

I am searching for a simple command to see logged on users on server. I know this one :

Get-WmiObject -Class win32_computersystem

but this

6条回答
  •  盖世英雄少女心
    2020-11-29 23:11

    In search of this same solution, I found what I needed under a different question in stackoverflow: Powershell-log-off-remote-session. The below one line will return a list of logged on users.

    query user /server:$SERVER
    

提交回复
热议问题