title: View ALL users logged on to Windows 10 computer
body: <p>I am trying to view all users currently accessing my computer on Windows 10.
  Using the following Powershell command shows me all users:</p>
  
  <p><code>(Get-CimInstance Win32_LoggedOnUser).antecedent.name | Select-Object -Unique</code></p>
  
  <p>This is great, as it also shows users logged in via PSRemote sessions. So let's say user <code>A</code> logs into my PC (<code>PC-B</code>) via an interactive PSRemote session:</p>
  
  <p><code>Enter-PSSession -ComputerName PC-B</code></p>
  
  <p>It will show me that the user is logged on. Yet once user <code>A</code> closes the PSRemote session, the username is still being listed. Also the <code>Get-CimInstance</code> command also doesn't show users that might be accessing a specific network share on <code>PC-B</code>.</p>
  
  <p>Is there a way to view ALL users logged in, whether it is via Network Share, Remote, RDP or locally? Seeing users accessing a Network Share is not so important, but all other kinds are. Since the users in question are all domain users, do I have to query the DC?</p>