title: Machine's domain name in .NET?
body: <p>There gotta be an easy way to do this, I can't believe there's none. I have scanned through net and found, like, 20 different methods to find in which domain current user is, but none to get domain (or workgroup) of current machine.</p>
  
  <p>In unmanaged c++ this is retrieved by:</p>
  
  <pre><code>WKSTA_INFO_100 *buf;
  NetWkstaGetInfo(NULL, 100, (LPBYTE*)buf);
  domain_name = pBuf-&gt;wki100_langroup;
  </code></pre>
  
  <p>can someone help me, if there's a way to get same info in managed C# natively?</p>
  
  <p>EDIT1: <strong>Folks, please read the question. I am NOT looking for user domain name.</strong></p>