How do you programmatically determine whether a Windows computer is a member of a domain?

后端 未结 7 685
情话喂你
情话喂你 2020-12-31 09:43

I need a way to determine whether the computer running my program is joined to any domain. It doesn\'t matter what specific domain it is part of, just whether it is connecte

7条回答
  •  太阳男子
    2020-12-31 10:18

    You can check the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon for the value of 'CachePrimaryDomain'.

提交回复
热议问题