title: Output domain COMPUTERNAME and logged in USERNAME spreadsheet
body: <p>So the boss asked for a spreadsheet that would show him all the computers in our enterprise and the users that are currently logged in.</p>
  
  <p>I stopped asking "why?" and started with NBTSTAT. The &lt;03> results were inconsistent. Then I tried NET CONFIG WORKSTATION, and finally PSLOGGEDON.EXE (SYSINTERNALS). These were good, but I'd have to find a way to pass the results of NET VIEW and format the output nicely for a csv.</p>
  
  <p>But then I thought there must be a better way. 90% of our PCs are WinXP so I could use WMIC or maybe DSQuery. I'd rather isolate the command execution to the workstations in our AD Computers container and not touch our Servers.</p>
  
  <p>Does anyone have any recommendations?</p>