VBScript program to determine the role of all computer objects in the domain. The program uses ADO to retrieve the sAMAccountName of all computer objects. Then the program uses WMI to connect to each computer and retrieve the DomainRole attribute from the Win32_ComputerSystem class. This attribute indicates if the machine is a workstation, a member server, or a domain controller. If desired, you can modify the program to only output computers with a particular role.

The program must connect to each computer in the domain. This could make it slow in a large network. Also, if any computers do not have WMI installed, the attempted connection will timeout, which will further slow the program. The program will indicate if any clients do not have WMI. WMI is included with the operating system on computers with Windows 2000 or above. In addition, WMI can be installed on any other 32-bit Windows client.

ComputerRoles.txt <<-- Click here to view or download the program