How can I determine if a server is a domain controller?

T

Tony Bright

I am running several servers with Windows 2000.

How can I determine which servers are domain controllers
and which are member servers?
 
C

Citimouse

I am no Windows expert.

If you the Windows see that the Windows 2000 server has Active Directory,
most probably it is a domain controller. As for member server, as long as
the server is join to the domain but no ADS, it can be considered as a
domain member server.
 
T

Torgeir Bakken (MVP)

Tony said:
I am running several servers with Windows 2000.

How can I determine which servers are domain controllers
and which are member servers?

Hi

You could read out the the DomainRole property in the Win32_ComputerSystem WMI
class with a VBScript:

http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_computersystem.asp


Here is a script you can use:


sComputer = "." ' use "." for local computer
WScript.Echo DomainRole(sComputer)

Function DomainRole(sNode)
Set oWMI = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & sNode & "\root\cimv2")
Set colComputer = oWMI.ExecQuery _
("Select DomainRole from Win32_ComputerSystem")
For Each oComputer in colComputer
iDR = oComputer.DomainRole
Next

Select Case iDR
Case 0
DomainRole = "Standalone Workstation"
Case 1
DomainRole = "Member Workstation"
Case 2
DomainRole = "Standalone Server"
Case 3
DomainRole = "Member Server"
Case 4
DomainRole = "Backup Domain Controller"
Case 5
DomainRole = "Primary Domain Controller"
Case Else
DomainRole = "Unknown"
End Select

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top