title: VB using WMI - get logged in users
body: <p>How can I use VB scripting with WMI to get the # of logged in users. My installation can only have one user logged in and needs to report an error if more than one user is logged in (via terminal service using Citrix). I don't know that much about Citrix but the <code>Win32_LogonSession</code> with <code>LogonType = 10</code> seems to return all kinds of junk (ports sessions, etc.). I just need the users...are there any WMI calls that I can just get the # of users logged into Citrix? Below is a snip of my VB code:</p>
  
  <pre><code>Set objWMIService = _
      GetObject("winmgmts:" &amp; "{impersonationLevel=impersonate}!\\" &amp; _
      strComputer &amp; "\root\cimv2") 
  Set colComputer = _
      objWMIService.ExecQuery("Select * from Win32_LogonSession Where LogonType = 10")
  </code></pre>
  
  <p>Thanks!
  -jp</p>