Click to Rate and Give Feedback
MSDN
MSDN Library
WMI Reference
WMI Classes
Win32 Classes
 Win32_NTDomain Class
Win32_NTDomain Class

The Win32_NTDomainWMI class represents a Windows NT 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

class Win32_NTDomain : CIM_System
{
  string   Caption;
  string   ClientSiteName;
  string   CreationClassName;
  string   DcSiteName;
  string   Description;
  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;
  datetime InstallDate;
  string   Name;
  string   NameFormat;
  string   PrimaryOwnerContact;
  string   PrimaryOwnerName;
  string   Roles;
  string   Status;
};

Methods

The Win32_NTDomain class does not define any methods.

Properties

The Win32_NTDomain class defines the following properties.

Caption
Data type: string
Access type: Read-only
Qualifiers: MaxLen(64)

Short 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

Name of the first concrete class in the inheritance chain that is used to create an instance. Use this property with other properties of the class to identify all of the instances of the class and its subclasses. 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

Comment that describes the link. 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.

ValueMeaning
1

DNS_INET_ADDRESS

2

DNS_NETBIOS_ADDRESS

 

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 an object is installed. An object does not require a value to indicate that it is installed. This property is inherited from CIM_ManagedSystemElement.

Name
Data type: string
Access type: Read-only
Qualifiers: Key

Name of an object. This property is inherited from CIM_ManagedSystemElement.

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

Contact information for the primary system owner. 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
Access type: Read-only

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
Qualifiers: MaxLen(10)

Current status of an object. Various operational and nonoperational statuses can be defined. Operational statuses include: OK, Degraded, and Pred Fail, which is an element such as a SMART-enabled hard disk drive that may be functioning properly, but predicts a failure in the near future. Nonoperational statuses include: Error, Starting, Stopping, and Service, which can apply during mirror resilvering of a disk, reloading a user permissions list, or other administrative work. Not all status work is online, but the managed element is not OK or in one of the other states. This property is inherited from CIM_ManagedSystemElement.

The values are:

"OK"
"Error"
"Degraded"
"Unknown"
"Pred Fail"
"Starting"
"Stopping"
"Service"
"Stressed"
"NonRecover"
"No Contact"
"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

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

For C++ code examples, see WMI C++ Application Examples.

Requirements

Minimum supported clientWindows XP
Minimum supported serverWindows Server 2003
MOFWmipcima.mof
DLLWmipcima.dll
Namespace\root\cimv2

See Also

Operating System Classes

Send comments about this topic to Microsoft

Build date: 11/3/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Win32_NTDomain sample with Powershell      Thomas Lee   |   Edit   |   Show History
# Display-NTDomain.ps1
# Displays the Win32_NTDomain data using WMI
# thomas lee - tfl@psp.co.uk

get-wmiobject | win32_ntDomain

On my Windows Server 2008 RC1 VM based test system, this code produces the following output:

PS C:\foo> gwmi win32_ntdomain

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
  
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker