As with many WMIC commands , the NTDomain alias supports the ASSOC, CREATE, DELETE,
GET, LIST, and SET actions. You use these actions just as you would for
any other alias. The important issue is that you can obtain Active
Directory information using the NTDomain alias for the local machine.
Remember that WMIC is essentially a local configuration command and not a
global settings command.
NOTE
It's important to
remember that you can't use WMIC to promote your server to a domain
controller. You also can't use the OCSetup utility to perform the task.
The correct utility to perform a promotion is the DCPromo utility. To
use the DCPromo utility, simply type DCPromo at the command line and press Enter. If you want to use advanced options with DCPromo, include the /adv command line switch. When you have an answer file to use with the DCPromo utility, include the /answer:Filename command line switch, where Filename is the name of the file you want to use. You can learn about how DCPromo works at http://technet2.microsoft.com/windowsserver/en/library/8faf4c77-4a89-4167-b6b4-f29cc8f2fd381033.mspx.
When working with the
CREATE action, you only have access to the DomainGuid property. The
system automatically generates a Domain Globally Unique Identifier
(GUID) when you promote the system to a domain controller. If you're
using the system only for a local network, the GUID provided should be
unique. Even though the GUID should be unique everywhere, there is a
small chance that you could find it repeated due to the technique used
by the Open System Foundation (OSF) algorithm of basing part of the GUID
on the Media Access Control (MAC) address of the Network Interface Card
(NIC) in your server. Consequently, when working with very large
networks in multiple countries, you may want to use the CREATE action to
install a new Universally Unique Identifier (UUID), which is guaranteed
to provide a unique number. You can see the structure of a GUID at http://msdn2.microsoft.com/en-us/library/aa373931.aspx. If you don't have any other means of generating a UUID, you can use the tool found at http://www.famkruithof.net/uuid/uuidgen. To use this feature, type WMIC NTDomain CREATE DomainGuid="5d694368-7041-11dc-8314-0800200c9a66" (where you supply your own UUID) and press Enter.
You may eventually need to remove some properties from the domain
configuration. Of course, verify these properties exist first by typing WMIC NTDomain GET
and pressing Enter. Once you determine which property you need to
delete, it's a good idea to use interactive mode to do it. For example,
if you decide to delete the current DomainGuid property value, type WMIC NTDomain DELETE/INTERACTIVE:DomainGuid
and press Enter. Always use interaction mode because the WMIC utility
shows you what you're deleting before you delete it. If you've selected
the wrong property, press N to stop the deletion. The list of available properties for the NTDomain alias include:
Caption | DSDnsForestFlag |
ClientSiteName | DSGlobalCatalogFlag |
CreationClassName | DSKerberosDistributionCenterFlag |
DcSiteName | DSPrimaryDomainControllerFlag |
Description | DSTimeServiceFlag |
DnsForestName | DSWritableFlag |
DomainControllerAddress | InstallDate |
DomainControllerAddressType | Name |
DomainControllerName | NameFormat |
DomainGuid | PrimaryOwnerContact |
DomainName | PrimaryOwnerName |
DSDirectoryServiceFlag | Roles |
DSDnsControllerFlag | Status |
DSDnsDomainFlag | |
The GET and LIST actions work much as you expect them to.
Because there's only one entry for the NTDomain alias (since there is
only one server), the LIST format can work better than using GET. The
only available writeable property for SET is the Roles property. Since
there is no CALL action associated with this alias, your configuration
options are limited, but you can still get a lot of information about
the domain at the command line.