Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. <code> 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 </code> check_if_server_is_domain_controller_script.txt Last modified: 2011/07/25 15:43by mmuze