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