I'm trying to detect either by calling an API or using WMI whether a computer is connected to a domain.
I am currently reading the env. variable USERDOMAIN to check whether I am connected to a domain or not but that only works for domains that I know. Is there a better way to see whether I am connected to a LAN/domain?
The code is in C, for windows XP or 7.
thank you.