2

How do I get information whether the system is configured as domain controller or not programatically on windows.

Raymond Chen
  • 44,448
  • 11
  • 96
  • 135
Manya K
  • 33
  • 2

2 Answers2

2

You can avoid the HKLM read, GetVersionEx's OSVERSIONINFOEX.wProductType will equal VER_NT_DOMAIN_CONTROLLER

Alex K.
  • 171,639
  • 30
  • 264
  • 288
1

Examine the registry key HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions\ProductType. A domain controller will have the value LanmanNT. LINK

Carey Gregory
  • 6,836
  • 2
  • 26
  • 47