Partager via


Win32_NTDomain class

The Win32_NTDomain WMI class represents a Windows domain.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties and methods are in alphabetic order, not MOF order.

Syntax

[Dynamic, Provider("CIMWin32a"), UUID("78F4FA18-EE46-4D4C-AB9B-8CC0D42B7038"), AMENDMENT]
class Win32_NTDomain : CIM_System
{
  string   Caption;
  string   CreationClassName;
  string   Description;
  datetime InstallDate;
  string   Name;
  string   PrimaryOwnerContact;
  string   PrimaryOwnerName;
  string   Status;
  string   ClientSiteName;
  string   DcSiteName;
  string   DNSForestName;
  string   DomainControllerAddress;
  sint32   DomainControllerAddressType;
  string   DomainControllerName;
  string   DomainGUID;
  string   DomainName;
  boolean  DSDirectoryServiceFlag;
  boolean  DSDnsControllerFlag;
  boolean  DSDnsDomainFlag;
  boolean  DSDnsForestFlag;
  boolean  DSGlobalCatalogFlag;
  boolean  DSKerberosDistributionCenterFlag;
  boolean  DSPrimaryDomainControllerFlag;
  boolean  DSTimeServiceFlag;
  boolean  DSWritableFlag;
  string   NameFormat;
  string   Roles[];
};

Members

The Win32_NTDomain class has these types of members:

Properties

The Win32_NTDomain class has these properties.

Caption

Data type: string

Access type: Read-only

Short textual description of the object. This property is inherited from CIM_ManagedSystemElement.

ClientSiteName

Data type: string

Access type: Read-only

Name of the site where the domain controller is configured. This value can be NULL.

CreationClassName

Data type: string

Access type: Read-only

Qualifiers: CIM_Key

Name of the class or subclass used in the creation of an instance. When used with other key properties of the class, this property allows all instances of the class and its subclasses to be uniquely identified.

This property is inherited from CIM_System.

DcSiteName

Data type: string

Access type: Read-only

Name of the site where the domain controller is located. This value can be NULL.

Description

Data type: string

Access type: Read-only

Textual description of the object. This property is inherited from CIM_ManagedSystemElement.

DNSForestName

Data type: string

Access type: Read-only

Name of the root of the DNS tree.

DomainControllerAddress

Data type: string

Access type: Read-only

Address of the discovered domain controller.

DomainControllerAddressType

Data type: sint32

Access type: Read-only

Type of address specified in the DomainControllerAddress property.

DS_INET_ADDRESS (1)

DS_NETBIOS_ADDRESS (2)

DomainControllerName

Data type: string

Access type: Read-only

Computer name for the discovered domain controller.

DomainGUID

Data type: string

Access type: Read-only

Globally unique identifier (GUID) of the domain controller. This property is 0 (zero) if the domain controller does not have a GUID.

DomainName

Data type: string

Access type: Read-only

Name of the domain.

Example: microsoft.com

DSDirectoryServiceFlag

Data type: boolean

Access type: Read-only

If TRUE, the domain controller is a directory service server.

DSDnsControllerFlag

Data type: boolean

Access type: Read-only

If TRUE, the Domain Controller Name is in DNS format.

Example: www.mynode.com or 135.5.33.19

DSDnsDomainFlag

Data type: boolean

Access type: Read-only

If TRUE, the DomainName value is in DNS format.

DSDnsForestFlag

Data type: boolean

Access type: Read-only

If TRUE, the DNSForestName value is in Domain Name System (DNS) format.

DSGlobalCatalogFlag

Data type: boolean

Access type: Read-only

If TRUE, the domain controller is a Global Catalog server for the DNSForestName value.

DSKerberosDistributionCenterFlag

Data type: boolean

Access type: Read-only

If TRUE, the domain controller is a Kerberos Key Distribution Center for the domain.

DSPrimaryDomainControllerFlag

Data type: boolean

Access type: Read-only

If TRUE, the domain controller is the Primary Domain Controller.

DSTimeServiceFlag

Data type: boolean

Access type: Read-only

If TRUE, the domain is running the Windows Time service.

DSWritableFlag

Data type: boolean

Access type: Read-only

If TRUE, the domain controller hosts a writeable DS or security accounts manager (SAM).

InstallDate

Data type: datetime

Access type: Read-only

Date and time the object was installed. This property does not need a value to indicate that the object is installed. This property is inherited from CIM_ManagedSystemElement.

Name

Data type: string

Access type: Read-only

Qualifiers: Override ("Name"), Key

Label by which the object is known.

NameFormat

Data type: string

Access type: Read-only

Format to generate the system name using the subclass heuristic.

This property is inherited from CIM_System.

PrimaryOwnerContact

Data type: string

Access type: Read-only

How the primary system owner can be reached (for example, phone number or email address).

This property is inherited from CIM_System.

PrimaryOwnerName

Data type: string

Access type: Read-only

Qualifiers: MaxLen (64)

Name of the primary system owner.

This property is inherited from CIM_System.

Roles

Data type: string array

Access type: Read/write

An array of strings that specify the roles the computer system plays in the IT environment. Values are defined by the IT environment in which the computer system resides. For example, for an instance of a networking system, this property might contain the string, "Switch" or "Bridge".

This property is inherited from CIM_System.

Status

Data type: string

Access type: Read-only

Current status of the object. This property is inherited from CIM_ManagedSystemElement.

Values include the following:

OK ("OK")

Error ("Error")

Degraded ("Degraded")

Unknown ("Unknown")

Pred Fail ("Pred Fail")

Starting ("Starting")

Stopping ("Stopping")

Service ("Service")

Stressed ("Stressed")

NonRecover ("NonRecover")

No Contact ("No Contact")

Lost Comm ("Lost Comm")

Remarks

The Win32_NTDomain class is derived from CIM_System. You can use this class to list all of the domains that can be discovered from the local computer. However, the number of domains that the provider can discover is limited by permissions, trust relationships, and network latency. To discover to which domain a particular computer belongs, you can query the Win32_ComputerSystem instance on that computer, and then check the Domain property.

Examples

The List Domain Information Using WMI VBScript code sample on TechNet Gallery uses Win32_NTDomain to retrieve information about domains discovered on the network.

The following PowerShell code sample describes how to query for Win32_NTDomain.

get-wmiobject | win32_ntDomain

On a Windows Server 2008 VM-based test system, the previous code produces the following output:

ClientSiteName          : Default-First-Site-Name
DcSiteName              : Default-First-Site-Name
Description             : GKTRAIN
DnsForestName           : gktrain.net
DomainControllerAddress : \\10.10.1.61
DomainControllerName    : \\DC1
DomainName              : GKTRAIN
Roles                   :
Status                  : OK

Requirements

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMV2
MOF
Wmipcima.mof
DLL
Wmipcima.dll

See also

CIM_System

Operating System Classes