title: Winform user authorization via active directory
body: <p>I have a situation where I am using the following code to verify user membership in AD before executing tasks in my app</p>
  
  <pre><code>using System.Security.Principal;
  WindowsIdentity  identity = WindowsIdentity.GetCurrent();
  WindowsPrincipal principal = new WindowsPrincipal(identity);
  return principal.IsInRole("someGroup");
  </code></pre>
  
  <p>The above code works fine for machines on my domain, however I do have some machines which are not on my domain on which I have the WINFORM application installed. How can I verify the user membership in AD? </p>
  
  <p>Edit - is there a way to prompt the windows login?</p>