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.
In unmanaged c++ this is retrieved by:
WKSTA_INFO_100 *buf;
NetWkstaGetInfo(NULL, 100, (LPBYTE*)buf);
domain_name = pBuf->wki100_langroup;
can someone help me, if there's a way to get same info in managed C# natively?
EDIT1: Folks, please read the question. I am NOT looking for user domain name.