title: Impersonating the current computer through WindowsIdentity
body: <p>I am trying to get the WindowsIdentity for the computer account the current user is logged into.</p>
  
  <p>Currently I am using the following code to get the group membership of the current user:</p>
  
  <pre><code>WindowsIdentity currentIdent = WindowsIdentity.GetCurrent();
  foreach (IdentityReference indentity in currentGroups)
  {
    String groupName = indentity.Translate(typeof(NTAccount)).ToString();
  }
  </code></pre>
  
  <p>This works fine, but I also need to do the same for the current computer account preferably without querying AD.</p>
  
  <p>I beleive that I will have to do this using Impersonation but have not been able to find out how.</p>