title: How to get active session user SID?
body: <p>How to get active session user SID? (it is current user session)</p>
  
  <p>I can do this using CMD command:</p>
  
  <pre class="lang-batch prettyprint-override"><code>for /f "tokens=2-4" %a in ('qwinsta') do @if "%c"=="Active" wmic useraccount where name='%a' get sid
  </code></pre>
  
  <p>Maybe someone can tell me how to do same with VBScript?</p>
  
  <p>By "current user" I mean "the account that started the script before UAC made me enter Admin credentials".</p>