Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
It is important to know whether a computer is part of a domain because this helps determine the means by which a computer can be managed. Computers that do not belong to a domain and do not have accounts in Active Directory cannot be managed by using Group Policy or software installation and maintenance.
For example, a single domain-level Group Policy can be applied to computers that are members of a domain. Stand-alone computers, by contrast, must be managed on an individual basis by using local Group Policy. Domain membership also affects the availability of resources for anyone using that computer.
The role that a computer plays within a domain (workstation, server, or domain controller) also impacts the management of that computer. For example, when you use scripts that automatically install software or configure a computer, you need to know the computer role because:
In these instances, verifying a computer s role before you install software or configure a service helps ensure that you install the correct software on the computer or use the correct service account for the role of the computer.
The DomainRole property of the Win32_ComputerSystem class can be used to identify the basic role of a computer and its membership in a domain. This property returns one of the values shown in Table 9.4.
Table 9.4 DomainRole Property Values
Value | Description |
---|---|
0 | Stand-alone workstation (the computer is not a member of a domain) |
1 | Member workstation |
2 | Stand-alone server (the computer is not a member of a domain) |
3 | Member server |
4 | Backup domain controller |
5 | Primary domain controller |
Listing 9.12 contains a script that identifies the basic role of a computer. To carry out this task, the script must perform the following steps:
This step is required because the DomainRole property is stored as an integer (for example, the value 0 for the DomainRole property means that the computer is a stand-alone workstation). This step converts the integer to the appropriate string value.
Listing 9.12 Identifying the Basic Role of a Computer
|
|
Send us your feedback | « Previous | Next » |