Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How can i determine a domain controller??


1 reply to this topic

Fouad Rziki

Fouad Rziki
  • Members
  • 43 posts

Posted 23 September 2002 - 09:15

Finally back from holiday;)

Does anyone know how to determine, if a windows 2000 server is configured as a domain controller, and if so , how can I get the domain name. Is there an IS functions to do this, or do I have to get the information from the registry.

Thanks in advance!
Fouad

j_freitas

j_freitas
  • Members
  • 1 posts

Posted 12 November 2002 - 16:07

Hi...

To accomplish this, I wrote a C DLL (using Dev Studio) where I exported a IsLocalMachinePDC() function that I could call from within InstallShield after issuing the InstallScript UseDll() function.  Inside my IsLocalMachinePDC() function I used the Windows SDK call NetServerEnum() to get all domain controllers on the network (by initializing a sturcture before the call -- see the MSDN for NetServerEnum()).  Then you can walk that list and determine if the local machine (I'm assuming you have it's name already) is in the list.

Good luck.

Justin