I am attempting to identify either by calling an API or using WMI whether some type of computer is attached to a website.

I'm presently reading through the env. variable USERDOMAIN to check on whether I'm attached to a website or otherwise but that only works best for domain names which i know. It is possible to better method to decide if I'm attached to a LAN/domain?

The code is within C, for home windows XP or 7.

thanks.

Try NetGetJoinInformation. It can provide you with four results.


NetSetupUnknownStatus  The status is unknown.

NetSetupUnjoined       The pc isn't became a member of.

NetSetupWorkgroupName  The pc is became a member of to some workgroup.

NetSetupDomainName     The pc is became a member of to some domain.