title: Get Current user name in Windows Service
body: <p>I tried:</p>
  
  <pre><code>var curUser = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
  </code></pre>
  
  <p>But, it is giving the output "NT AUTHORITY\SYSTEM " as the current user name after deploying the service.</p>