Windows Server 2003 Domains Active Directory
Windows Server 2003 Domains Active Directory
A-List
No part of this publication may be reproduced in any way, stored in a retrieval system
of any type, or transmitted by any means or media, electronic or mechanical,
including, but not limited to, photocopy, recording, or scanning, without prior
permission in writing from the publisher.
A-LIST, LLC
295 East Swedesford Rd.
PMB #285
Wayne, PA 19087
702-977-5377 (FAX)
mail@alistpublishing.com
http://www.alistpublishing.com
All brand names and product names mentioned in this book are trademarks or
service marks of their respective companies. Any omission or misuse (of any kind) of
service marks or trademarks should not be regarded as intent to infringe on the
property of others. The publisher recognizes and respects all marks used by
companies, manufacturers, and developers as a means to distinguish their products.
1-931769-00-1
03 04 7 6 5 4 3 2 1
A-LIST, LLC titles are distributed by Independent Publishers Group and are available
for site license or bulk purchase by institutions, user groups, corporations, etc.
Introduction
This book is based on Windows 2000 Domain & Active Directory published in March
2001. It has been totally revised and adapted to conform to the Windows .NET
Server 2003 environment and over 100 pages have been added. (From now on, all
products of the Windows .NET Server 2003 family will be referred to as Windows
.NET for short.) As a result, this book will be useful for those administrators who
currently work with Windows 2000 domains and for those who are planning to deploy
Active Directory on Windows .NET servers. For an administrator, the new version of
Active Directory does not have any new principle features, and all options that are
only available on Windows .NET servers are specifically described in the book.
Therefore, an administrator can deal with any version of Active Directory domains
and compare the working environment's features with those that were on the old
platform.
Many books have already been published which cover Active Directory's goals, its
advantages and disadvantages, strategies for developing Active Directory in a large
corporate network, and other important questions that have not changed with the
advent of Windows .NET. (However, this does not mean that the new version of
Active Directory is not more mature, effective, and convenient for administrators than
the initial version that appeared in Windows 2000!) In this book, the author has tried
to take a look at the more practical problems that come up while using Active
Directory. Even though the book may not offer an answer to all the problems that
might arise, you will at least learn how to approach them.
One probably would not even consider repairing a defective car or a complex
electronic device without special additional tools and facilities. Nonetheless,
administrators who work with Active Directory often forget that the problems which
come up in the process of working with Active Directory are also impossible to
eliminate without the help of the appropriate tools and utilities. Most of the tools that
you need for working with Active Directory (and that are looked at in this book) are
furnished along with the system, and are found in the Windows Support Tools pack.
This book is dedicated, to a large extent, to working with exactly these tools. A few
tools and scripts from the Windows 2000 Server Resource Kit are also considered,
since they work properly in the Windows .NET environment.
Besides, the author would like to turn administrators' attention to methods of program
access to Active Directory, and in part to scripts that use the Active Directory Service
Interfaces (ADSI). Scripts can be used to solve many administrative tasks, and you
may use already written scripts after a minimal number of modifications to fit your
needs. Creating scripts does not require you to be a highly qualified programmer — a
fact which the author tried to get across in the last two chapters of the book.
This book is geared towards a relatively prepared reader, one who has already had
some experience working with Windows 2000, and is familiar with the basic work
methods and components of the system (e.g., with Microsoft Management Console
snap-ins). However, information on these questions can easily be found in the Help
system.
Chapter 1, "LDAP Basics," covers one of the standards that make up the basis
of Active Directory — the Lightweight Directory Access Protocol (LDAP).
In Chapter 2, "Active Directory Terminology and Concepts," relates the
essential Active Directory concepts. The terms and concepts described in
Chapter 1 and in this chapter will be widely used in the rest of this book;
therefore, their knowledge will affect how the reader understands Active
Directory operating mechanisms and topics described later in the other
chapters. New Active Directory features offered by domain controllers running
Windows .NET are also reviewed.
Chapter 3, "Domain Name System (DNS) as Main Naming Service,"
comprises Active Directory requirements of mandatory DNS service, as well
as new DNS features introduced in Windows .NET.
The Glossary will help you find a short description of an unfamiliar term quickly, or to
verify your understanding of this term.
The "How to …?" section is set up like a typical FAQ. In this section, you may find the
solution you need for a specific problem faster than if you were to simply look through
the table of contents or the Index.
For finding references to a certain utility or tool in the Index, use its file name. You
can also find references to interfaces, methods, properties, attributes, enumerations,
etc., the same way — under their names.
Conventions
This means that the line shown should be considered as one, unbreakable
line.
As you can see from the previous example, the mandatory elements of a
command line — the command name and the parameters — are in bold in
order to be more visible. The other elements of the command are specific to
your environment and you should determine them.
Part I: Active Directory Fundamentals
and Standards
Chapter 1: LDAP Basics
Chapter 2: Active Directory Terminology and Concepts
Chapter 3: Domain Name System (DNS) as Main Naming Service
There are two Internet standards that appeared long before Active Directory, but
which are very closely related to it. These standards are Lightweight Directory
Access Protocol (LDAP v3) and Domain Name System (DNS). It is impossible to
speak about Active Directory without using the terms stated by these standards. That
is why in the first three chapters of the book, we will discuss the terminology and
concepts that are widely used in the remaining chapters.
Use of the Active Directory service (both on Windows 2000 and Windows .NET
operating systems) requires a good understanding of the LDAP protocol basics since
this protocol is used everywhere for accessing directory information. Familiarity with
and knowledge of LDAP are also necessary for working with many tools and utilities,
such as the Active Directory Administrative Tool (Ldp.exe), ADSI Edit snap-in,
Search.vbs script, LDIF Directory Exchange utility (LDIFDE.exe), and others, and are
needed for scripting as well. This concerns all four LDAP models discussed below.
Therefore, before we begin to discuss the Active Directory installation, administrative
snap-ins, system tools, and other topics, let us first review the LDAP concepts. Then,
some Active Directory specific terms and technologies will be considered in the next
chapter.
Note All main features of LDAP v3 are described in RFC 2251 through RFC 2256.
Refer to these RFCs for more information, or check out the Q221606 article in
the Microsoft Knowledge Base. You may also find links to other related
standards there.
Informational Model
The informational (data) model of the LDAP protocol, and therefore, of Active
Directory as well, is based on X.500 — the International Standards Organization
(ISO) special standard defining elements of a distributed directory service. This
standard proposes an object-oriented data model; therefore, it uses such terms as
class, instance, and inheritance.
Schema
The schema defines classes and attributes, from which all directory objects can be
derived. The schema itself is stored in the directory as a set of objects.
Classes
Each directory object is an instance of one or more classes defined in the schema. In
general, every object inherits from at least one structural object class and zero or
more auxiliary object classes. There are three types of classes:
Abstract classes serve as templates for deriving new abstract, auxiliary, and
structural classes. Abstract classes cannot be instantiated in Active Directory,
i.e., you cannot create a directory object of an abstract class. The definition of
an abstract class can include any number of auxiliary classes.
Structural classes are derived from abstract or structural classes and inherit all
attributes of all parent classes. Active Directory objects can only be instances
of structural classes. The definition of a structural class can include any
number of auxiliary classes.
An auxiliary class is derived from an abstract or auxiliary class and can be
included in the definition of a structural, abstract, or auxiliary class. The
defined class inherits all attributes of the auxiliary class listed in the
mustContain, systemMustContain, may Contain, and systemMayContain
properties. Auxiliary classes cannot be instantiated in Active Directory. The
definition of an auxiliary class can include any number of auxiliary classes.
Attributes
Attributes contain the data used to describe properties of the defined classes.
Attributes may be mandatory or optional, single- or multi-valued. An attribute is
defined in the schema by a name and an object identifier (OID). Attributes are
defined in RFC 2252 and RFC 2256. Here are the examples of attributes (these are
the values of the lDAPDisplayName and attributeID attributes of the attributeSchema
objects in the Schema container):
nTSecurityDescriptor (1.2.840.113556.1.2.281)
distinguishedName (2.5.4.49)
Attribute Syntax
The attribute syntax (see RFC 2252) defines the type of an attribute (e.g., a Unicode
string, a number, an octet string, etc.), byte ordering, and the matching rules for
comparisons of property types. The syntax of LDAP attributes is represented by
object identifier (OID). For example:
RootDSE Object
Note Directory System Agent (DSA) is the system process that provides clients with
access to directory information physically stored on a hard disk of a domain
controller, or directory server. In Active Directory servers running on Windows
2000 or Windows .NET, the DSA is a part of the Local System Authority (LSA)
subsystem.
RootDSE has properties that can be retrieved programmatically (see Listing 17.2) or
by using a query tool (such as Ldp.exe or the ADSI Edit snap-in). To query a
RootDSE from Ldp.exe, specify the empty base DN, the base scope, and the filter
objectClass=*. (Search operations will be considered a bit later.) It is possible to bind to
a specific server, or to use a server-less query. In the latter case, the first available
LDAP server (a Windows 2000-or Windows .NET-based domain controller) will
respond. Here is an example of the RootDSE data:
1> currentTime: 6/12/2002 9:29:2 Central Standard Time Central Standard Time;
1> subschemaSubentry:
CN=Aggregate, CN=Schema, CN=Configuration, DC=net, DC=dom;
1> dsServiceName: CN=NTDS Settings, CN=NETDC2, CN=Servers, CN=NET-Site, CN=Sites,
CN=Configuration, DC=net, DC=dom;
5> namingContexts: CN=Configuration, DC=net, DC=dom;
CN=Schema, CN=Configuration, DC=net, DC=dom; DC=subdom, DC=net, DC=dom;
DC=DomainDnsZones, DC=net, DC=dom; DC=ForestDnsZones, DC=net, DC=dom;
1>defaultNamingContext: DC=subdom, DC=net, DC=dom;
1> schemaNamingContext: CN=Schema, CN=Configuration, DC=net, DC=dom;
1> configurationNamingContext: CN=Configuration, DC=net, DC=dom;
1> rootDomainNamingContext: DC=net, DC=dom;
20> supportedControl: 1.2.840.113556.1.4.319; 1.2.840.113556.1.4.801;
1.2.840.113556.1.4.473; 1.2.840.113556.1.4.528; 1.2.840.113556.1.4.417;
1.2.840.113556.1.4.619; 1.2.840.113556.1.4.841; 1.2.840.113556.1.4.529;
1.2.840.113556.1.4.805; 1.2.840.113556.1.4.521; 1.2.840.113556.1.4.970;
1.2.840.113556.1.4.1338; 1.2.840.113556.1.4.474; 1.2.840.113556.1.4.1339;
1.2.840.113556.1.4.1340; 1.2.840.113556.1.4.1413; 2.16.840.1.113730.3.4.9;
2.16.840.1.113730.3.4.10; 1.2.840.113556.1.4.1504; 1.2.840.113556.1.4.802;
2> supportedLDAPVersion: 3; 2;
11> supportedLDAPPolicies: MaxPoolThreads; MaxDatagramRecv;
MaxReceiveBuffer; InitRecvTimeout; MaxConnections; MaxConnIdleTime;
MaxPageSize; MaxQueryDuration; MaxTempTableSize; MaxResultSetSize;
MaxNotificationPerConn;
1> highestComittedUSN: 124992;
4> supportedSASLMechanisms: GSSAPI; GSS-SPNEGO; EXTERNAL; DIGEST-MD5;
1> dnsHostName: netdc2.subdom.net.dom;
1> ldapServiceName: net.dom:netdc2$@SUBDOM.NET.DOM;
1> serverName: CN=NETDC2, CN=Servers, CN=NET-Site,
CN=Sites, CN=Configuration, DC=net, DC=dom;
3> supportedCapabilities: 1.2.840.113556.1.4.800;
1.2.840.113556.1.4.1670; 1.2.840.113556.1.4.1791;
1> isSynchronized: TRUE;
1> isGlobalCatalogReady: TRUE;
1> domainFunctionality: 2;
1> forestFunctionality: 2;
1> domainControllerFunctionality: 2;
(Notice the numbers at the beginning of the lines — they indicate the number of
values within an attribute.)
RootDSE contains the following standard attributes (refer to RFC 2251 and 2252):
altServer — references to other servers that can be used when this server
becomes unavailable. By default, this attribute is absent on Active Directory
servers.
namingContexts — the list of naming contexts stored on the server. Notice that in
our example, the domain naming context (directory partition) refers to the
subdom.net.dom domain, but two other contexts, the Schema and
Configuration, refer to the forest root domain — net.dom. These contexts
should be used when searching the directory. Windows .NET-based domain
controllers can also store application directory partitions, and this attribute lists
their names, too. In the example, you can see the distinguished names of two
application partitions: domainDnsZones.net.dom and
forestDnsZones.net.dom.
subschemaSubentry — the name of the subschema entry (or the abstract
schema; see Chapter 16, "Active Directory Service Interfaces (ADSI)"). This
object contains definitions of available attributes and classes.
supportedControl — the object identifiers (OID) of the LDAP controls that the
server supports. This attribute may be absent. In comparison with Windows
2000, Windows .NET-based domain controllers support four new controls.
supportedExtension — the object identifiers (OIDs) of the extended LDAP
operations that the server supports. By default, this attribute is absent on
Active Directory servers.
supportedLDAPVersion — the LDAP versions supported by the server.
supportedSASLMechanisms — the Simple Authentication and Security Layer
(SASL) mechanisms supported by the server. This attribute may be absent. In
comparison with Windows 2000, Windows .NET-based domain controllers
support two new controls.
Naming Model
The naming model defines how directory objects can be uniquely specified. The OSI
directory model uses distinguished names for that purpose.
CN=Domain Controllers
OU=Staff
DC=net
SAM (Pre-Windows 2000) Account Names. SAM account names are required
for compatibility with down-level clients. A SAM name must be unique within a
domain.
Globally Unique Identifiers – the Globally Unique Identifier (GUID) is a 128-bit
number, which uniquely identifies the object when it is created. It never
changes and ensures that the object will be addressed — even if it has been
renamed or moved.
Fully Qualified Domain Name (FQDN) is also known as the full computer
name; this is a concatenation of the host name (the NetBIOS name) and the
primary DNS suffix, for example:
netdc2.subdom.net.dom
User Principal Names – the User Principal Name (UPN) consists of the user
logon name and a UPN suffix (the current or root DNS domain name, or a
specially created shortened name), for example, JohnS@net or John@net.dom.
UPN is intended for simplified logon and can be used for logging on to the
network on a computer that can belong to any domain within the forest.
LDAP Uniform Resource Locator (URL). LDAP URLs are used by LDAP-
enabled clients for accessing Active Directory objects. LDAP URLs can also
be used as binding strings in scripts and applications, for example (the server
name is optional):
LDAP://netdc4.net.dom/CN=John Smith,OU=Staff,DC=net,DC=dom
Active Directory Canonical Name. Canonical names are used in the
administrative snap-in's user interface for displaying object names. A
canonical name is similar to the distinguished name without the naming
attribute specifiers (DC, CN, etc.). For example, the canonical name for the
LDAP URL shown above is:
net.dom/Staff/John Smith
Referrals
Functional Model
The functional model describes the operations that can be conducted with
information stored in a directory using the LDAP protocol. You need to be able to
access information, and read and update it as well. These operations are
implemented in somewhat different ways for various system tools that use the LDAP
protocol, but the main concepts and parameters remain the same.
Authentication
Open — this command creates and initializes a connection block, and then
opens a connection to the DSA.
Bind — this command initiates a protocol session to the DSA and
authenticates the client to the DSA.
Unbind — this command terminates a session, frees all resources associated
with the session, and closes a connection.
Interrogation
Search
The widely used search operations retrieve information based on user criteria.
Search operations have the following parameters:
Search base — the distinguished name of a directory object (called the base
object) from which the search begins (e.g., DC=net, DC=dom or OU=Stuff, DC=net,
DC=dom).
Note All search parameters are mandatory. Many LDAP-compatible tools and
utilities, such as DsQuery, LDIFDE, Search.vbs, and so on, do not
require that users specify some parameters. However, this only means
that these tools themselves substitute some default values instead of the
missed parameters.
Note The search base can also have the "<GUID=…>" format (the angle
brackets are included!) (e.g., "<GUID=0855ae368790cb4b8726cf37cb2222a5>").
Search scope — defines the depth of searching relative to the search base
(Fig. 1.1 shows various scopes for the domain object). There are three
options:
Base. Only the base object is searched (i.e., you will work with properties of
the base object only).
One level. The children of the base object are searched; the base object itself
and grandchildren are excluded.
Subtree. The entire subtree is searched, beginning with and including the
base object (i.e., all "visible" objects in the subtree).
Filter. A rule (see RFC 2254) for selecting objects from a subtree (e.g., (cn=*)
or & (objectCategory=Person) (cn=d*) ).
Selection. A list of attributes returned from the selected objects that match the
filter.
Optional controls. LDAP functions that extend or modify a LDAP operation;
for example, you may ask the LDAP server to sort the results or return a large
result set in small pages. (See examples of using some LDAP controls in
Chapter 12, "Manipulating Active Directory Objects.")
Figure 1.1: Search scopes for a domain object (which is the search base)
Types of Filters
Condition Filter
Logical NOT (all users with name that begin with (& (objectClass=user) (cn=a*) (!
"A" except "Administrators") (cn=adm*)))
Selection Options
Usually, you provide the list of object attributes returned by a query. There are,
however, a few special cases:
If you only need the objects' DNs rather than their attributes, specify OID 1.1
as the selection.
It is possible to specify the attribute OID instead of its name; for example, you
can replace objectClass with 2.5.4.0.
The query produces a result similar to the following (only one entry from the list is
shown):
...
ADsPAth 140 = LDAP://CN=User-Principal-Name,CN=Schema,
CN=Configuration, DC=net, DC=dom
attributeID 140 = 1.2.840.113556.1.4.656
attributeSyntax 140 = 2.5.5.12
isSingleValued 140 = True
lDAPDisplayName 140 = userPrincipalName
oMSyntax 140 = 64
...
The compare operation returns a Boolean result (TRUE or FALSE) based on the
comparison of an attribute value with a specified value.
The LDAP server resources, which are available to clients that make LDAP queries
and request paged or sorted result sets, are limited by the Default Query Policy.
Administrative limits constitute the query policy objects which are stored in the
container CN=Query-Policies,CN=Directory Service,CN=Windows NT,CN=Services
in the Configuration partition.
If there are no assigned policies, all domain controllers use the default query policy. A
site policy can also be assigned. However, if a specific policy has been assigned to a
domain controller, this policy overrides all others. There is no UI for assigning a policy
to a site. You can do this by manually editing the queryPolicyObject attribute of the
NTDS Site Settings object of the nTDSSiteSettings class object. Use the ADSI Edit
snap-in. It is also possible to use the ModifyLDAP.vbs script (see below).
Search. By default, you cannot obtain a result set whose size exceeds 1000
rows. You need to use a paged search to perform operations that generate a
significant amount of information. Also, you may exceed the default timeout
set for search operations.
Paged search. The client may ask the server to hold the result set and return
it in pages. In this case, the query policy defines the page size. (See also
comments to Listing 16.1.)
Search with Sorted Results. The requested result set can be sorted in a
particular order. This operation can significantly overload the LDAP server.
Search with Replication. The client can specify the maximum number of
attribute values that can be returned per request.
Change Notify. The client can request change notification in an asynchronous
LDAP query. The query policy can limit the number of simultaneous
asynchronous requests.
There are two standard tools that allow you to work with LDAP query policies (see
Chapter 10, "Diagnosing and Maintaining Domain Controllers"):
The NTDSutil.exe tool. This tool can only be used with the Default Query
Policy object. It allows you to view or modify the query policy of a domain
controller.
The ModifyLDAP.vbs script from the Windows 2000 Server Resource Kit. This
script can create, delete, assign, or modify the query policy objects.
Update
Add allows user to create an object, which must meet the schema
requirements for the object class.
Modify creates, modifies, and deletes attributes of an object.
Modify RDN is actually an operation of renaming or moving an object to
another location.
Delete deletes an object (if it is possible and the user has the appropriate
rights to the object).
Security Model
To provide secure access to an LDAP server, the LDAP v.3 protocol allows the use
of Simple Authentication and Security Layer (SASL) mechanisms. Active Directory
confirms the LDAP v.3 requirements and, therefore, supports SASL mechanisms,
which include Kerberos version 5 and MS Negotiate (on Windows 2000). The
supported-SASLMechanisms attribute of the RootDSE object stored on every Active
Directory server (a domain controller running on Windows 2000 or Windows .NET)
contains two values: GSSAPI and GSS-SPNEGO. GSSAPI means Kerberos, and
GSS-SPNEGO stands for NT Negotiate (Kerberos, NT LAN Manager (NTLM), etc.).
Windows .NET-based domain controllers also support two other SASL mechanisms:
EXTERNAL and DIGEST-MD5.
LDAP Ports
The connections via the LDAP protocol between a client and DSA use either a
Transmission Control Protocol (TCP) or User Datagram Protocol (UDP). The table
below lists the protocol sockets used in different access modes:
Function Port
LDAP 389
LDAP Secure Sockets Layer (SSL) 636
Global Catalog (GC) 3268
Global Catalog Secure Sockets Layer 3269
Logical Organization
The Active Directory service is the foundation for domains managed by domain
controllers (that are also called Active Directory servers) running Windows 2000
or/and Windows .NET. A domain is a group of logically linked computers and users
who work on them and are united by an idea of centralized management.
All "housekeeping" tasks are performed on domain controllers that hold the Active
Directory database which contains information about managed objects such as
users, computers, groups, and so on. This information is stored as directory objects
of corresponding types. User, group, and computer (and InetOrgPerson—in Windows
.NET) objects (so-called accounts) represent security principles that can be granted
privileges to perform certain computer-, domain, or forest-wide tasks or permissions
for access to shared network resources (such as files, folders, and printers). Thus, a
domain client being logged on to the domain once using an account can access all
allowed resources without needing to log on repeatedly to each server holding a
resource. A domain administrator can change Active Directory objects on any domain
controller and, thus, control all options permitted to domain members. Therefore, a
domain is a boundary of administrative power.
In short, to deploy an Active Directory domain, you need to first plan it, install domain
controller(s), add domain client computers, and create user (and group) accounts.
Then you can share resources on domain members and assign necessary privileges
and permissions to users (and groups). (All required operations and tools used to
perform them will be described in this book in Chapters 3 through Chapter 8. The
remaining chapters consider problems that occur during exploitation of Active
Directory domains as well as all necessary system utilities.)
An Active Directory domain can contain sets of directory objects that are called
organizational units (OU), and that usually contain user or computer accounts. Each
OU can have its own administrator and a Group Policy Object (GPO)(s) linked to OU
object. The group policy technology is intended for centralized configuration of user
environment and computer system settings. GPOs can be local or linked to site,
domain, or OU objects.
Active Directory domains form a forest (a forest can comprise one or more domains),
where all domains are linked by two-way, transitive trusts. Trusts allow users logged
on to a domain to access resources located in any location in the forest, or to have
privileges in any domain. Administrator-created trusts can be established with foreign
Active Directory forests or Windows NT 4.0 domains.
Physical Organization
The entire Active Directory database is logically divided into directory partitions,
which are units of replication (i.e., each partition is replicated independently, although
the replication mechanisms, such as scheduled replication or notification procedure,
may affect all partitions). Since Active Directory is a distributed network database,
any domain controller holds a replica of the entire database.
Each replica counts at least three partitions: the Schema and Configuration partitions
that are shared by all domains in a forest and stored on every domain controller; and
domain partition that contains objects of a specific domain and is stored on domain
controllers that belong to that domain. Each forest has one more partition called
Global Catalog (GC), which contains a limited set of attributes of all Active Directory
objects. GC allows users to quickly find any directory object in the forest. GC is a part
of the Active Directory database and can be stored on any domain controller.
Active Directory can take into account the fact that a large enterprise network (a
forest) usually contains a number of subnets linked by fast and slow channels. A set
of subnets connected with fast channels can be referred to as a site. Sites, in turn,
are connected with slow (dial-up) channels. By default, all domains are placed in the
same Default-First-Site (which can be safely renamed).
Pre-Windows 2000 clients (running Windows 9x/ME and Windows NT 4.0) regard an
Active Directory domain (operating in any mode or at any functional level) as a
Windows NT domain, i.e., they can be authenticated in the domain and access the
shared domain resources (see also later the "Domain Modes and Functional Levels"
section).
Active Directory Client Extension allows pre-Windows 2000 clients to use some
Active Directory features, such as Active Directory Service Interfaces (ADSI), site
awareness, DFS fault tolerance, search options, and NTLM version 2 authentication
(see the Web or the Help and Support Center for a detailed description). Active
Directory Client Extension is available on the Windows 2000 Server CD or the
Microsoft website (the links are in Appendix A). Certainly, all of the listed features as
well as many others are available on Windows 2000/XP/.NET-based clients.
Active Directory Client Extension does not support some important Active Directory
options, such as Group Policy functionality, Kerberos V5 protocol, IPSec and L2TP,
nor does it allow users to browse through the Active Directory organizational units
(OU) and containers (thus, the only visual options that appear when the extension
has been installed on a computer are the For printers and For People commands
on the Start | Search menu).
This section covers the most important, and up-to-date Active Directory features that
are available on the Windows .NET Server family domain controllers and may allow
administrators to manage Windows .NET domains more efficiently (certainly, this will
not be a complete list of features).
Let us first discuss certain general domain and forest functionalities that, to some
degree, are common for both Windows 2000 and Windows .NET domains.
Windows 2000 domains can operate in either default mixed mode (when a domain
can contain Windows 4.0 Backup Domain Controllers, BDC) or native mode (when a
domain contains only Windows 2000-based domain controllers).
The following table lists three available domain functional levels and DC types
supported (or that can be introduced into the domain) at these levels:
Windows 2000 mixed (default) Windows NT 4.0, Windows 2000, and Windows .NET
Windows 2000 native Windows 2000 and Windows .NET
Windows .NET Windows .NET only
Two first levels correspond to the Windows 2000 modes, and aforementioned
considerations for the native mode domains are applicable to the Windows 2000
native functional level, too.
Among features that require the Windows .NET domain functional level is the Domain
Controller Rename option (see later). Native mode Windows 2000 domains as well
as Windows .NET domains at the Windows 2000 native or Windows .NET domain
functional level support the following features: universal groups; group nesting;
converting group types, and the SID History option (discussed in Chapter 13,
"Migration and Directory Reorganization Tools").
Forest functional levels define features available across all domains within a forest.
The following table lists two available forest functional levels and DC types supported
at these levels:
There is also a special Windows .NET Interim forest functional level that is only
available when a Windows NT 4.0 domain is upgraded to a new Windows .NET
forest, which does not contain domain controllers running Windows 2000. (When
upgrading a Windows NT 4.0 domain, you might also be interested in the Q284937
and Q298713 articles from the Microsoft Knowledge Base.)
The forest-wide features available at the Windows .NET forest functional level are
listed later in this chapter.
Keep in mind the following information regarding the domain modes or forest/domain
functional levels:
Any domain controller running Windows .NET provides new features described
below.
Saved directory queries in the Active Directory Users and Computers snap-
in
Selection and modification of multiple of directory objects
Drag-and-drop operations
Efficient search capabilities that include new filter and find options
An additional domain controller in a domain can be installed from the files restored
from a backup of an existing domain controller. This reduces the promotion time, as
well as network replication traffic. This installation type will be described in Chapter 5,
"Installing Active Directory."
All user authentication attempts are verified on a Global Catalog server to check user
membership in the universal groups. This process will generate additional traffic
across a WAN to a remote GC server. To eliminate the need to have a GC server in
every site, you can designate a DC to cache universal group membership and update
that information from a specified site. To learn how to enable caching, see Chapter 7,
"Domain Manipulation Tools."
An application partition can store any directory objects (except security principals)
defined in the schema (including dynamic objects). Objects in application partitions
are not replicated to Global Catalog. There are two built-in application partitions that
can be used by the Windows .NET DNS servers running on domain controllers (see
the next chapter for details).
To view the contents of application partitions, you can use the ADSI Edit snap-in
(see Chapter 7, "Domain Manipulation Tools"). To learn how to manage application
directory partitions, see Chapter 10, "Diagnosing and Maintaining Domain
Controllers."
The inetOrgPerson object class defined in RFC 2798 has been added to the Active
Directory schema to make migration from third party LDAP directories to Active
Directory more efficient. The objects of that class are the security principals and can
be used as standard user objects.
This section describes new features that are only available when the domain/forest
functional level has been raised to Windows .NET.
Rename Options
You can rename a domain controller without first demoting it or change the DNS or
NetBIOS name of any domain. Renaming a domain may result in moving it to other
location in the forest infrastructure. Detailed descriptions are provided later in this
chapter.
Forest Trusts
Forest trust is established between the forest root domains that operate at the
Windows .NET functional level and can have a one-way as well as a two-way
direction. Unlike usual external trusts, the forest trusts are transitive, i.e., they allow a
user authenticated in one forest to access resources located in any domain in
another forest.
Defunct Objects
Active Directory does not allow you to delete a directory object class or attribute: you
can only deactivate it. A deactivated class or attribute is called defunct. It is possible
to activate a deactivated class or attribute and redefine it, if there was an error when
the class or attribute was initially created.
Replication Enhancements
Some replication related problems existing in Windows 2000 have been addressed in
Windows .NET. Primarily, this concerns the enhanced linked value and Global
Catalog replication as well as algorithms used by the Knowledge Consistency
Checker (KCC) for generating replication topology in forests with large number of
sites.
Linked value replication reduces network traffic when group membership is changed:
only new or deleted group members are replicated instead of the entire list of group
members stored in the member attribute. This is essential for groups with a large
number of members.
Dynamic objects are instantiated from an object class that has the auxiliary class
dynamicObject. This class can also be added to an object instance by using a
program or script. As a result, a dynamic object exists during the time defined by a
Time-to-Live (TTL) value that is assigned at the object creation and can be renewed
by a client or an application (see also Appendix B).
Renaming Domains
The simplest case is when you rename a domain and do not change the forest
parent-child structure. A more complex case is when you change the domain position
in a forest tree, e.g., make a child domain a tree root domain or change the parent for
a child domain. The rename procedure may require many supplementary operations,
such as pre-creating additional inter-domain trusts, preparing DNS zones, configuring
member computers, and so on.
You cannot redefine the forest root domain (i.e., the forest root will always be
the same domain). However, you can change its DNS or/and NetBIOS name.
One cannot delete or add a domain: the total number of domains in a forest
must remain the same. A usual promotion/demotion procedure should be used
in such cases.
You cannot rename two domains in a single operation and give a domain the name
of another domain. The rename procedure requires quite a long, detailed description
— and so, it is inappropriate to include one here. You can find two comprehensive
operation guides (about 90 pages in total) on the Microsoft website (see the link in
Appendix A) if you are interested in learning more about this topic.
In a Windows .NET domain, you may rename a domain controller (i.e., change its
FQDN and NetBIOS names). To rename a domain controller from the local console:
Important To rename domain controllers, you must first raise the domain functional
level to Windows .NET. This is because only Windows .NET-based
domain controllers support the msDS-AdditionalDnsHostName, msDS-
AdditionalSamAccountName, and some other attributes necessary to
perform renaming. This means that it is not possible to rename a DC in
a Windows 2000 domain.
The rename operation does not change the domain membership of the
controller, i.e., it does not allow you to move a DC to another domain
(even if you change the primary DNS suffix). To do so, you must first
demote the DC and promote it with a new domain name.
To rename a remote domain controller, it is necessary to use the NetDom.exe utility.
The renaming procedure is not complicated and is described in the Help and Support
Center (search for the "rename controller" words).
Windows Time service provides computer clock synchronization for domain clients
and domain controllers. This is especially important on client computers running
Windows/XP/.NET and domain controllers since all of them rely on authentication
procedure that use Kerberos V5 protocol, which by default requires clock
synchronization with a delta of 5 minutes. The service operation is defined by registry
settings located in the HKLM\SYSTEM\CurrentControlSet\Services\W32Time key. (This key
will be the reference for all registry values mentioned in this section.)
Domain clients running Windows XP/.NET will automatically synchronize their clocks
with the PDC Emulator time upon their startup and authentication in the domain. A
domain's PDC Emulator, in turn, synchronizes its clock with the clock of the PDC
Emulator of a parent or forest root domain. The forest root domain's PDC Emulator
should synchronize its clock with an external timeserver(s) or you can leave it "as is".
To specify an external timeserver, use the net time /SETSNTP: timeSrvName command.
On Windows .NET DCs, you can also use the command
By default, all computers running Windows XP/.NET use the time.windows.com site
as the timeserver.
Note Each time you change the settings of the Windows Time service, restart it by
using the Service snap-in or from the command prompt (with the net stop w32time
and net start w32time commands).
When a client running Windows XP/.NET joins a domain, the Parameters\Type value is
automatically changed from default NTP to NT5DS. The same change is performed on
Windows .NET servers when they are promoted to domain controllers. On clients and
domain controllers running Windows 2000, you may either manually set the
Parameters\Type value or use the net time /SETSNTP command.
On computers running Windows XP/.NET, the following sample command allows you
to view the timeserver (marked as PDC) as well as the time offsets for computers in
the net.dom domain (if this parameter is omitted, the current domain is tested):
C:\>w32tm /monitor /domain:net.dom
netdc1.net.dom *** PDC *** [192.168.1.2]:
ICMP: 0ms delay.
NTP: +0.0000000s offset from netdc1.net.dom
RefID: 'LOCL' [76.79.67.76]
netdc4.net.dom [192.168.1.103]:
ICMP: 0ms delay.
NTP: -0.0100835s offset from netdc1.net.dom
RefID: netdc1.net.dom [192.168.1.2]
You could, for example, first promote a server to DC, and then prepare a DNS server
for dynamic updating of the appropriate zones. Enter the DNS server's IP address in
the DC's TCP/IP properties, and reboot the DC (or restart the Netlogon service and
execute the ipconfig /registerdns command). The result will be a fully operable
configuration! The same procedure is used when you select another authoritative
DNS server for a domain and want to re-register all necessary DNS records.
This chapter covers some general aspects of Active Directory and DNS
interoperation, as well as basic features of Microsoft DNS servers. In Chapter 4,
"Windows .NET DNS Server", operations with native Microsoft DNS servers will be
considered, and the DNS issues related to Active Directory deployment and
maintenance will be considered in Chapter 5, "Installing Active Directory."
Note Name-resolving systems, such as DNS and WINS, are a vast, complex topic.
There are plenty of good specialized books on TCP/IP, DNS, and Windows
2000 DNS Server in particular, and you may wish to read them to obtain a
deeper understanding of the DNS system in general and its realization in
Windows 2000. This information applies to Windows .NET DNS Server, too.
In this chapter and the entire book, "Microsoft DNS Server" refers to both
Windows 2000 DNS Server and Windows .NET DNS Server. The differences
between these products, if such exist, are specifically indicated when
necessary.
There are no "secret relations" between Active Directory and DNS. All that Active
Directory requires from DNS is a standard-resolving of DNS names (including some
system names) into IP addresses. The following two postulates are related to Active
Directory and DNS:
To meet Active Directory requirements, a DNS server must have two of the following
features:
The server must support resource records of the SRV type according to RFC
2052 ("A DNS RR for specifying the location of services (DNS SRV)"), since
SRV records are widely used by domain clients and domain controllers for
locating various directory resources, such as domain controllers, Global
Catalog servers, Kerberos servers, and so on.
The server must permit use of underscores ("_") in the DNS names, since this
character is used in the reserved system DNS names
(e.g.,_gc._tcp.domain.com). (See examples of system DNS names in the last
section of this chapter.)
One more feature is eagerly required for deploying Active Directory; however, it is
not mandatory.
The server should support dynamic updates of resource records according to RFC
2136 ("Dynamic Updates in the Domain Name System (DNS UPDATE)"). By default,
all Active Directory domain controllers and clients automatically register and update
the appropriate records of SRV, CNAME, and A types. If dynamic updates are not
supported, an administrator must manually manage all records, which is a difficult
task in a large network.
Any DNS server that meets at least the first two requirements can be used in an
Active Directory environment (e.g., Windows NT 4.0 DNS Server with SP 4 or higher;
however, that server does not support dynamic updates). For example, according to
many sources, the DNS BIND 8.2.2 server or later is suitable for work with Active
Directory.
Note Reverse zones are not necessary for Active Directory to work; and Active
Directory Installation Wizard will not create them. However, it is recommended
that you create the applicable reverse zones so that various DNS utilities and
tools (e.g., Nslookup or Ping) can work well.
As a rule, on both client computers and domain controllers running Windows 2000 or
later systems, the IP address(es) of the same preferred DNS server(s) that holds the
authoritative zone for a domain should be entered into the TCP/IP properties on the
DNS tab in the Advanced TCP/IP Settings window. This address must not be the
Internet Service Provider (ISP) DNS server's address. If necessary, the preferred
server should forward clients' queries for external domains to the ISP's DNS servers.
Integration with other network services, such as WINS and DHCP. (For
example, pre-Windows 2000 computers can neither register nor update their
DNS names directly; they can perform that operation through WINS, which
acts as an intermediary to DNS).
Interoperability with third party DNS servers. (For example, the Windows
.NET DNS development team has tested interoperability with the BIND DNS
server version 4.9.7, 8.1.2, 8.2, and 9.1.0.)
Support for secure dynamic updates that allows only domain-authenticated
clients to re-register DNS names.
Incremental zone transfers between DNS servers (zone transfers are only
required for non-Active Directory-integrated zones).
Support for Active Directory-integrated zones, i.e., zones that store their
data in the directory. These zones can only be created on DNS servers
running on domain controllers and, therefore, can benefit from Active Directory
multi-master replication.
The replication scope for a zone depends on the directory partition where it is
stored. On Windows 2000 DNS Servers, a zone can only be stored in a
domain partition that is replicated among domain controllers that belong to that
domain. Even if you create a zone with the same name in another domain,
there will be two different zones, which results in a big mess for the entire DNS
infrastructure. If two DNS servers Belong to different domains, one server
must be primary for the other one. On Windows .NET DNS Servers, the
situation is simpler since these DNS servers can store their data in application
directory partitions whose replication scope is defined by administrators (see
details in the "Domain Management" section in Chapter 10, "Diagnosing and
Maintaining Domain Controllers").
As any typical DNS server, Microsoft DNS Servers can operate in the following
modes:
Caching sever — as a rule, a standalone DNS server that does not host any
authoritative zones after its installation, and therefore only caches the clients'
queries. A caching Windows .NET Server can also hold stub zones.
Primary server — the server that hosts an updatable, authoritative zone(s) for
some domain(s), i.e., it is permitted to resolve client queries. Resource records
from such a server may be transferred to the secondary servers.
Secondary server — the server that hosts a read-only replica(s) of zone(s)
transferred from a primary (authoritative) server. However, if both the primary
and secondary DNS servers hold an Active Directory-integrated zone(s), these
servers can be regarded as peers that are able to accept updates. Active
Directory integrated zones require a DNS server running on a Windows 2000-
based domain controller.
Certainly, any DNS server can combine any of these modes; however, you need to
thoroughly plan operation modes of all DNS servers in your network, as well as
interoperations between these DNS servers and "external" servers, e.g., your ISP's
DNS servers.
Two main tools that can be used for administering local and remote Microsoft DNS
Servers are:
In comparison to Windows 2000, the Windows .NET Server family offers a few new
DNS related features that are implemented either in the system itself or in the
Windows .NET DNS Server. Let us consider features that are the most important for
administering both DNS servers and Active Directory domains:
All SRV and A resource records (20 in total, if the domain controller is a Global
Catalog server; 15 if it is not) that each Active Directory domain controller must
register on a DNS server, are contained in the %SystemRoot%\system32\config\
netlogon.dns file. (If your DNS server does not support dynamic records update, you
need to manually manage these records.) An example of such a file is presented
below.
Note It is possible to set a group policy that will prohibit registration of some or all
SRV records by Windows .NET domain controllers. This policy, DC Locator
DNS records not registered by the DCs, is located in the Computer
Configuration | Administrative Templates | System | Net Logon | DC
Locator DNS Records node of a Group Policy Object (GPO).
In this example: server name — netdc2.subdom.net.dom, domain name —
subdom.net.dom, root domain name — net.dom, site name — .NET-Site. The
records are sorted for clarity. The real order will differ, but this does not matter. The
records for a global catalog server are shown in bold. You can verify resource
records with the DNS snap-in.
As you can see, the first two r cords are of the A (host) and CNAME (alias) types,
respectively; the other records are of the SRV (service location) type. Let us discuss
the purpose of every record in the order that they are presented in the listing above.
DNSDomainName is the name of the current domain, e.g., subdom.net.dom.
DNSRootName is the name of the forest root domain (it can be also a tree root
domain name if there is only one tree in the domain structure), e.g., net.dom.
Important Do not confuse a tree root domain name (there may be a few in the
forest) with the forest root domain name (only one). For example, a forest
may include two domain trees with the root domains net.dom and
net2.dom. Only the first created domain — net.dom — will be the forest
root domain. Therefore, if the Global Catalog servers appear in the
net2.dom domain (or in any child domains), they will still register the
appropriate records in the net.dom DNS zone.
<DNSDomainName> — a client can use this A record to find a domain controller in the
domain by using a normal host record lookup.
Note Notice that all records for global catalog servers refer to the forest root domain
name.
To test the DNS configuration for the entire forest, use the Nslookup command. The
following sample dialog illustrates how to query the DNS server for the records
registered by the Global Catalog servers. (Input commands are in bold.)
C:\>nslookup
Default Server: netdc1.net.dom
Address: 192.168.1.2
> Set type=SRV
> _gc._tcp.net.dom
Server: netdc1.net.dom
Address: 192.168.1.2
_gc._tcp.net.dom SRV service location:
priority = 0
weight = 100
port = 3268
svr hostname = netdc2.subdom.net.dom
_gc._tcp.net.dom SRV service location:
priority = 0
weight = 100
port = 3268
svr hostname = netdc1.net.dom
netdc2.subdom.net.dom internet address = 192.168.1.102
netdc1.net.dom internet address = 192.168.1.2
>
To verify DNS records registered by a specific domain controller, you can use on that
DC the following commands:
netdiag /test:DNS (or netdiag /test:DNS /v) — a very powerful and trustworthy tool.
nitest /DSQUERYDNS — available on Windows .NET-based DCs; this command
does not test SRV records for application partitions.
For a Windows .NET domain controller, it is also possible to de-register (e.g., for the
test purpose) all SRV records with the command
This chapter deals with various aspects of Microsoft DNS Server installation and
configuration and covers two product versions: Windows 2000 DNS Server and
Windows .NET DNS Server. Most of the things considered can be applied to both
products (in such a case, we will call them the Microsoft DNS Server); the
differences, if they exist, are explicitly stated. (Windows NT 4.0 DNS Server is only
mentioned in the section "Configuring Windows 2000/.NET DNS Server for Use with
Legacy DNS.")
The DNS service is mandatory for Active Directory, and you should be familiar with
all DNS requirements within an Active Directory environment, which have been
discussed in detail in Chapter 3, "Domain Name System (DNS) as Main Naming
Service". You can skip this section if DNS service has already been deployed in your
network and configured accordingly. Some DNS specific problems will also be
considered in Chapter 5, "Installing Active Directory."
This chapter also contains an example of using a legacy DNS system (that, for
example, does not support SRV resource records and updatable DNS zones) for
deploying Active Directory.
Prerequisites
To install a Microsoft DNS Server successfully, you have to consider some issues
listed below.
IP Address
The server providing the DNS Service must have a static IP address. You should not
use the address assigned by a DHCP Server.
Important This IP address can be changed if needed, even if the DNS server is
running on a domain controller. (However, this is not a normal practice!)
In such a case, you also have to change the preferred DNS settings on all
domain clients and domain controllers and update registration of all DNS
resource records.
Before installing DNS service, you must check the primary DNS suffix for the server
(see "Setting the DNS Suffix" section). This is especially important if this server is
also going to be a domain controller. In that case, you can either set the DNS suffix to
be the same as the DNS name of the domain that the domain controller will belong
to, or first promote the server and then install the DNS service. In any configuration,
you must be sure that all names — the computer name (that includes the primary
DNS suffix), the domain name of a member server or domain controller, and the
name(s) of authoritative zone(s) stored on the DNS server — are consistent.
Planning DNS
Caching server
Primary server
Secondary server
A DNS server can perform all listed roles at the same time (for example, it can be the
primary server for one zone and the secondary server for another zone). In addition,
each zone can be stored in a standard text file or in Active Directory. Therefore, you
need first to carefully plan the DNS namespace and any questions related to DNS
(see details in the previous chapter).
To install and start the DNS service on a computer running Windows 2000/.NET
Server, use the standard Windows Component Wizard that can be found in the
Add/Remove Programs applet in the Control Panel. Select Network Services and
click Details. Check the Domain Name System (DNS) box and click OK and then
Next.
After the system files have been copied (the Windows 2000/.NET Server installation
CD will be required) and the service started, you will see a new DNS snap-in in the
Administrative Tools group. The DNS service is now installed on the computer and
needs to be configured.
At first, the new DNS server running on a normal server will work as a caching server
and will not be authoritative for any zones. Look up the DNS Server log in the Event
Viewer to be sure that the service was started successfully. (If you have installed the
DNS server on a domain controller, its behavior will be different; see the next
sections of this chapter.)
To configure and manage a Microsoft DNS Server, run the DNS command from the
Administrative Tools menu. In the DNS snap-in's main window (see Fig. 4.1), you
can use a convenient wizard — New Zone Wizard that will help you to create forward
and reverse zones.
Fig. 4.1: The DNS snap-in's main window containing a few authoritative zones
When you simultaneously install Active Directory and the DNS service on a server
that is the first domain controller in the network, the Active Directory Installation
Wizard (DCpromo.exe) automatically creates an authoritative zone for the forest root
domain on the DNS server. (If a DNS server already exists, you must first manually
create a zone for the new forest and enable dynamic updates of the zone.)
When a child domain in an existing forest is created, the zone of the forest root
domain is used, and the wizard itself will create an authoritative zone for that child.
(You may change this behavior; see later in this chapter.) However, if you add a tree
to a forest, you must manually create an authoritative zone for the new DNS name-
space. Therefore, you always need to create the authoritative zones for every new
domain tree manually (or new forest), except with simultaneous installation of Active
Directory and DNS service on the same server.
Caution The Dcpromo utility does not create any reverse zones on the DNS server.
Therefore, to make the DNS server configuration fully operational, it is
recommended that you: manually create an appropriate reverse zone
(because some utilities and applications use it), enable dynamic updates for
it, and re-register the domain controller address with the ipconfig / registerdns
command.
Secure updates are only enabled for Active Directory-integrated zones. These zones
are available if only the DNS server is installed on a domain controller.
When a text file zone becomes Active Directory-integrated, the appropriate zone file
is moved from the %System Root%\system32\dns folder to the nested \backup
folder. At the same time, new objects (of dnsZone and dnsNode types) for the zone
are created in the Active Directory in the System/MicrosoftDNS container in the
domain partition (if zones are stored on domain controllers) or within the appropriate
application partition (on a Windows .NET Server). The reverse transformation of a
zone (from Active Directory-integrated zone to text file zone) is also possible.
Important Remember that Windows 2000 does not support application directory
partitions. Therefore, to enable a DNS server running on a Windows 2000
DC to replicate Active Directory-integrated zones from a Windows .NET
DNS server running on a Windows .NET DC, you must select the
appropriate zone replication scope.
By default, the forward forest root domain authoritative zone (that includes the
_msdcs subdomain, or node) and the root zone (".") are created as Active Directory-
integrated and allow Only secure updates. This means that only authenticated users
can update records. Sometimes, the Yes option in the Allow dynamic updates? list
appears to be a better choice.
The "." zone, configured by default, makes the DNS server the root server, which
prevents clients' queries from being sent — forwarded — to an external DNS name-
space, e.g., to the Internet. To enable forwarders, you can just delete the "." zone. By
default, the DNS server's IP address is specified on the Root Hints tab in the
server's Properties window. If you have deleted the "." zone, make sure the server
name has also been deleted from that tab.
The root zone (".") is not created by default on Windows .NET DNS servers. As a
result, the DNS server can "natively" resolve DNS queries for external names (e.g.,
the Internet names) provided that the default gateway has been configured for the
server and network connectivity has been established. In that case, root hints are
used. To resolve external queries more efficiently, you may specify a DNS server's IP
address (e.g., the server of your Internet Service Provider, ISP) on the Forwarders
tab in the server's Properties window.
By default, the Dcpromo utility creates two authoritative zones: the forest zone and
the domain system zone _msdcs (see Fig. 4.1). Both zones are Active Directory-
integrated and allow Only secure updates. The former zone is stored in the Domain
DnsZones application partition that is replicated to all DNS servers in the forest root
domain. The latter zone is stored in the Forest DnsZones application partition that is
replicated to all DNS servers in the entire forest. Therefore, to enable a Windows
2000 DNS server running on a Windows 2000 DC to support these zones, you
should change the replication scope of these zones.
You can increase the reliability of your network and install an additional (backup)
DNS server. This task will be very simple if all the zones are Active Directory-
integrated and the DNS server is installed on a domain controller. In that case, all
DNS servers will be peers, and the term "secondary server" is not applicable since
the authoritative zone(s) can be updated on any server.
When an additional DNS server has been installed, you may add the server's IP
address to the list of DNS servers on every domain client computer or domain
controller.
You can easily diagnose the problem by looking up the System log after creating the
first domain controller. (It is strongly recommended that you check all logs when each
DC is created!) After the domain controller boots, the warning (ID 5773) from
Netlogon may appear in the System log; Windows .NET systems provide a clear
issue explication:
The following DNS server that is authoritative for the DNS domin controller
locator records of this domain controller does not support dynamic DNS updates:
DNS server IP address: 192.168.1.155
Returned Response Code (RCODE): 4
Returned Status Code: 9004
USER ACTION
Configure the DNS server to allow dynamic DNS updates or manually add
the DNS records from the file
'%SystemRoot%\System32\Config\Netlogon.dns' to the DNS database.
Let us take a specific scenario and discuss in detail how to solve the problem. To
simplify the situation, we will use a minimal number of computers.
Suppose we have an existing Windows NT 4.0 DNS server authoritative for the
net.dom domain. The server stores the forward and reverse zones: net.dom and
1.168.192.in-addr.arpa. All domain controllers and clients (including Windows
2000/XP/.NET computers) have to use this server as preferred.
Note Remember that reverse zones are not necessary for Active Directory, but rather
provide a fully operational DNS configuration.
The second DNS server (based on a Windows 2000 or Windows .NET server) has to
be configured to support all updateable resource records for an Active Directory
domain. Computer names and addresses are shown in the table below:
By default, the dynamic registration of a host's name and address on the preferred
DNS server is enabled; so, in our scenario we need to disable registration on all
Windows 2000/XP/.NET computers to avoid error messages in the computers'
System logs. To do this, reset the Register this connection's addresses in DNS
flag on the DNS tab in the Advanced TCP/IP Setting window. Then, you have to
manually create a host record (type A) for each domain controller and computer on
the preferred server.
On the Windows .NET DNS server, we need to create four dynamic authoritative
zones necessary for domain functioning. These zones will answer the DNS queries
for specific IP addresses that could not be resolved by the preferred server. In our
scenario, all these zones' names have the net.dom suffix. (In general, these zones
can be either standard or Active Directory-integrated.)
_msdcs.net.dom
_sites.net.dom
_tcp.net.dom
_udp.net.dom
Furthermore, we also have to allow dynamic updates of these zones. Fig. 4.6
illustrates the result obtained in this preliminary step. Notice that each zone has SOA
and NS records. This means that the server that supports such a record can resolve
DNS queries stored in that zone.
Fig. 4.6: Creating dynamically updatable authoritative zones on a Windows .NET
DNS server
It is now necessary to create the dynamic zone names in the domain authoritative
zone and delegate them to the Windows .NET DNS server, where the zones will be
stored and updated. All zone names are created as domains within the main
authoritative zone net.dom. (The procedure described below will also help you to
create a zone on any type of DNS server and delegate the zone to another DNS
server.) The following operations have to be carried out:
1. Right click the main zone name and select the New Domain command from
the context menu. Create four necessary domains.
2. Right click a created domain (e.g., _msdcs.net.dom) and select the New
Record command the context menu. Then you must select the NS Record
type and specify the DNS name of the server that stores the authoritative zone
with the same name. Repeat this step for each created domain.
The result that should be obtained is illustrated in Fig. 4.7. (A Windows NT 4.0 Server
SP6a was used.) All DNS queries for records that belong to the zones shown will be
addressed to the DNS server NETDC1 (that is authoritative to resolve these queries).
Fig. 4.7: Authoritative DNS server for domain net.dom and the zones delegated to the
dynamic DNS server NETDC1
In addition, we need to register the following records on the Windows NT 4.0 DNS
server in the domain authoritative zone:
Two type A (host) records (with corresponding PTR records) for the Windows
.NET computers: NETDC1 and NETDC4. (Such records will be necessary for
each domain computer.)
A type A (host) record for the net.dom name (this record is needed for finding
a domain controller using a simple name lookup). To create such a record,
select a usual A Record, leave out its name, and specify the IP address of a
domain controller (NETDC4). (This record must be created for each domain
controller in the net.dom domain.)
The latter type A record requires additional attention. By design, this record is
dynamically updatable. The domain controllers' Netlogon service re-registers it after
each system boot. In our case, an update is impossible, so an error message will be
periodically generated in the System log. You may get rid of the problem by adding
the RegisterDNSARecords DWORD value (set the value to 0x0) to the registry subkey
HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters.
net.dom. IN A 192.168.1.4
and
gc._msdcs.net.dom. IN A 192.168.1.4
Resulting Configuration
Thus, we have covered the preliminary steps and now the domain controller NETDC4
is able to update (or first to create) all necessary SRV records. You need to restart
the Netlogon service or, preferably, reboot the system. (You can also use the nltest
/DSREGDNS command.) After this, you will get all updatable records on the Windows
.NET DNS server (NETDC1) (Fig. 4.8).
Fig. 4.8: The name structure of all needed SRV records, shown on a dynamic DNS
server
Now you can (and should) check all DNS logs and test the domain controller to be
sure that all records have been registered correctly.
After you have installed DNS service on a Windows 2000/.NET Server, or if you
already have a functioning Microsoft DNS server (or a third party DNS server), you
may wish (or rather, need) to verify the DNS configuration. This is especially
important if you use an "outside" DNS server (a server running on a remote computer
or even in another organization). It is not enough that you yourself think that all DNS
parameters are properly set; rather, it is the system and program tests that should
confirm that everything is working fine.
You must check that the DNS server holds the correct forward and reverse zones
and that these zones allow dynamic record updates. For testing Microsoft DNS
Servers, it is helpful to use a general-purpose command-line DnsCmd.exe utility (that
is standard in Windows .NET, or has been included in the Windows 2000 Support
Tools pack). You can start it from any computer that has access to the inspected
DNS server. This utility can perform all operations necessary for remote maintenance
of a Microsoft DNS server.
To verify a zone, use the /enumzones command. You will get an output similar to the
following (which is the output for the simplest configuration):
Zone count = 8
Zone name Type Storage Properties
. Cache AD-Domain
_msdcs.net.dom Primary AD-Forest Update
1.168.192.in-addr.arpa Primary AD-Forest Update Rev
net.dom Primary AD-Domain Update
In this case, netdcl.net.dom is the Microsoft DNS Server name, "." corresponds to the
cached lookups, net.dom is an authoritative zone name and the DNS name of the
future domain, and 1.168.192.in-addr.arpa is a manually created reverse zone for the
private network 192.168.1.0 (255.255.255.0 mask; the address and mask depend on
your network configuration).
The Update parameter indicates whether or not the zone is dynamically updatable.
You can also check this property of zones (e.g., the net.dom zone) using the following
command. (Be careful; in the Windows 2000 version of DnsCmd, the AllowUpdate and
other zone properties are case-sensitive!):
You must also verify DNS server responsiveness. It is recommended that you do this
before any DC creation in a Windows 2000 environment (in Windows .NET, similar
tests are built-in), in order to avoid serious domain problems in the future. Enter the
following command on the inspected computer (a client, or a server to be promoted):
C:\>nslookup 192.168.1.2
192.168.1.2 is the DNS server's IP address, specified in the TCP/IP properties of that
computer. The result will be similar to the following output:
Server: netdcl.net.dom
Address: 192.168.1.2
Name: netdcl.net.dom
Address: 192.168.1.2
Here, the Server reply contains the DNS server name, and Name is the name
resolved from the specified IP address. In this case, the names are the same
(because we have asked the DNS server for its own name), but you may want to
resolve any other IP addresses if their corresponding host names are registered on
the DNS server. You may also verify resolving DNS computer names into IP
addresses, for example: nslookup net.dom.
Note In contrast to DnsCmd.exe, the Nslookup command can be used with any type
of DNS servers.
If you receive any different outputs or error messages, like "Can't find server name
for address" or "Default servers are not available," you need to check all TCP/IP
properties, the connectivity and the existence of forward and reverse zones. The
DNS server may reply with the aforementioned messages, if, for example, the server
is operational but the reverse zone is absent or corrupted.
After a domain controller is created (and especially when the first DC in the forest is
created), it is strongly recommended that you verify the registration of all necessary
SRV records (see Chapter 3, "Domain Name System (DNS) as Main Naming
Service"). You can check an SRV record with the DNSCmd.exe utility by entering, for
example, the command (asking the SRV record registered by the PDC operations
master):
In conclusion, it is worth repeating that the best command for testing domain
controllers is the DcDiag.exe utility that reliably verifies DNS issues for a specified
computer. For example, if the following command returns no information, you may be
sure that the selected DC is "healthy":
C:\>dcdiag /s:netdc4.net.dom /q
All described procedures will help you to avoid some pitfalls of domain functioning.
Do not forget to set aside at least a half an hour for DNS testing. Take your time and
be thorough, or you could spend days trying to resolve potential problems, such as
"why is network reaction so slow?" or "why doesn't the new domain controller
replicate data?"
To set the primary DNS suffix on a computer running Windows 2000/XP/.NET, open
the System Properties window (press <Win>+<Break>, or right click My computer
on the Start menu or the desktop, and click Properties). Then, click Properties on
the Computer Name tab (in Windows 2000 — Network Identification), click
Change, and More. In the pop-up window (Fig. 4.9), enter the DNS name of the
domain to which the computer will belong.
Fig. 4.9: Setting the DNS suffix of the computer
Note Note that the Change primary DNS suffix when domain membership
changes checkbox must be normally set. This is especially important for
servers that have to be promoted.
You can manage the primary DNS suffix by using a group policy. See the
Primary DNS Suffix policy at the node Computer Configuration |
Administrative Templates | Network | DNS Client.
An administrator who is not yet closely acquainted with Active Directory must be
aware of the two following postulates:
Administrators, even those who are quite experienced, should always remember that
the DNS is the "heart" of Active Directory domains, and many, many faults, all very
different by nature (e.g., issues related to the authentication process, or applying
group policies to users and computers), can derive from an improperly configured
DNS system. That is why troubleshooting practically every domain-level problem
should begin with verifying the DNS configuration. And that is why the DNS related
issues are mentioned in this chapter again.
This chapter does not contain step-by-step descriptions of all typical operations;
instead, it deals with only the most important issues.
Note In this chapter, "Windows DNS Server" means either a Windows 2000 DNS
Server or Windows .NET DNS Server, depending on the platform used.
Installing Domain Controllers
Therefore, you can create an Active Directory domain controller (DC) in the following
ways:
We will not discuss this topic in detail, since all the necessary information pertaining
to it can be found quite easily in the Help and Support Center. Let us note the most
important aspects only.
During your second step, you will need to prepare each domain with the adprep
/domainprep command that should be run on the Infrastructure Masters separately.
If you try to add a Windows 2000 DC to a Wndows .NET (version 2002) level domain,
or to create a Windows 2000 domain within a Windows .NET (version 2002) level
forest, the Active Directory installation will fail. The system reports "An error with no
description has occurred" in the former case, or "Indicates two revision levels are
incompatible" in the latter.
Note See also the section entitled "Adding a Windows NT 4.0 BDC to a Windows
2000/.NET Domain."
The Active Directory can be installed only if several critical conditions are met. The
Active Directory Installation Wizard (DCpromo.exe) will check different parameters
depending on the type of DC that is being created. Among these conditions are the
following:
Active Directory can be installed only on a NTFS 5.0 formatted disk partition.
This partition must have at least 250 MB of free space. (This does not mean
that all that space will be employed at once; the default size of the Active
Directory database including the log files is about 40 Mbytes. However, the
system must have reserved space for normal work.)
If the server is a standalone computer, only a user that is a member of the
local Administrators group can start DCpromo.exe. If the server is a member
of a domain, members of the Domain Admins and Enterprise Admins groups
can also initiate promotion.
When a new DC is created in an existing forest, any user that is not logged on
as a domain or enterprise administrator must provide sufficient credentials (a
pre-Windows 2000 logon name and a password; names in UPN form, e.g.,
admin@net.dom, are not acceptable):
Only members of the Enterprise Admins group can create new domains
(child domains or new trees). It is possible to have a pre-created new
domain in the forest (see the description of NTDSutil.exe in Chapter 10,
"Diagnosing and Maintaining Domain Controllers").
The members of the Domain Admins and the Enterprise Admins groups
are permitted to add a DC to an existing domain. The privileges to join a
computer to the domain and create the appropriate replication objects
can also be given to some user accounts.
TCP/IP protocol must be installed and configured on the computer. Typically,
domain controllers have static IP addresses (however, conceptually this does
not necessarily have to be the case).
The computer should have the primary DNS suffix (see the previous chapter).
This is a critical requirement if the computer is also going to act as a DNS
server. For an ordinary domain controller, the Change primary DNS suffix
when domain membership changes checkbox must at least be set. The
suffix will be properly set if the computer is a member of a domain, and you
need not change anything.
An already deployed DNS service must be available. If a legacy or third party
DNS server is used, it should meet the Active Directory requirements and be
properly configured. If the promoted server is the first DC and there is no DNS
server in the network, you must allow the Active Directory Installation Wizard
to install and configure the Windows DNS server.
Important If you create the first DC and enable the DNS installation and
configuration on the same computer, you must assign an
applicable IP address (e.g., 192.168.1.1) to the computer and
specify that address as the preferred DNS server address. The
Active Directory Installation Wizard will not do this itself, and as a
result, the new domain (forest) will not be operational!
Note A reverse DNS zone is not required for Active Directory. Nevertheless, it
is recommended that you configure one for the other applications that
use it.
The server NetBIOS name must be unique in the domain. The NetBIOS (pre-
Windows 2000) name of new domain must be unique in the forest.
If a child domain (or a new tree) is created, the parent and forest root domains
must exist and be accessible. This means that you cannot create a child
domain — e.g., subdom.net.dom — if the net.dom domain does not exist.
Without going into detail and in order to considerably simplify the situation, it is
possible to say that all FSMO masters should be available for starting and
successfully completing server promotion. Otherwise, you should always know
and remember which FSMO masters are required for each specific type of
domain controller created (an additional DC, a new tree, and so on).
Note By default, all domain controllers will be created in the Domain Controllers OU
in the domain partition.
Note The computer SID remains the same after the Active Directory installation or
removal.
Note Let us suppose a server was previously a domain controller and has been
demoted, and that you wish to install the Active Directory on to it again. It may
be useful to make sure that the folders where the Active Directory files (the
database and logs) were stored have been deleted (by default, the
%SystemRoot%\NTDS folder is used). Moreover, if the Distributed File System
(DFS) is not used on this computer, stop the File Replication Service by using
the net stop ntfrs command and delete the contents of the
%SystemRoot%\ntfrs\jet folder. Then restart the service: net start ntfrs.
Important During one of the preliminary steps, the Active Directory Installation
Wizard asks for your "Directory Services Restore Mode Administrator
Password". This password is only used in the logon process after you
have pressed the <F8> key in the boot menu and selected the Directory
Services Restore Mode. The password is not used often, so try not to
forget it (this does happen!).
Verifying DNS Configuration
DNS testing is one of the most important steps in preparing a server for promotion.
Any undetected errors in DNS configuration may result in an inoperable domain
controller. The following DNS related faults are possible:
Microsoft has done a great job in extending the initial functionality of the DCdiag and
NetDiag utilities from the Support Tools to allow an administrator to verify the DNS
configuration in a few seconds. (For a Windows 2000 environment, you can
download updated versions from the Microsoft website. For additional information on
these tools, see Chapter 10, "Diagnosing and Maintaining Domain Controllers" and
Chapter 11, "Verifying Network and Distributed Services.")
A further step has been taken in the Windows .NET Server family: the Active
Directory Installation Wizard diagnoses DNS-related and forest configuration issues
and stops server promotion if any problems exist. Nevertheless, you can use the
DCdiag and NetDiag utilities on computers running Windows .NET, too.
Important All tests described below verify DNS only; connectivity with existing
domain controllers is not checked. The Active Directory Installation
Wizard verifies both DNS and connectivity (including authentication)
issues.
If a preferred DNS server's IP address is not specified on the tested computer in the
TCP/IP Properties window, the dcdiag /test:DcPromo or dcdiag /test:RegisterInDNS
command outputs a message with the error 9852, which means "No DNS servers
configured for local system."
The following command reports that you can safely create an additional domain
controller in an existing Windows 2000 or Windows .NET domain (net.dom in this
example):
...
DNS configuration is sufficient to allow this domain controller to
dynamically register the domain controller Locator records in DNS.
The following output indicates that the authoritative zone (w2000.dom) exists, but
there are no SRV records registered by the existing domain controller(s):
...
DNS configuration is sufficient to allow this domain controller to
dynamically register the domain controller Locator records in DNS.
This might be a serious problem: the existing DC for the specified domain could be
promoted incorrectly. You should verify the DNS configuration and make the DC re-
register all its SRV records. Then run DCdiag on that DC.
In all cases when updating of an authoritative zone is not enabled on the DNS server
(or the server does not support dynamic updates), the command output will be similar
to the following:
Detailed instructions on configuring the DNS server are also displayed. You must
follow them. To check whether a zone is updatable, it is also possible to use the
command
Other parameters of the dcdiag /test:DcPromo command allow you to test whether you
can create a child domain, new tree, or new forest in the current domain structure.
The command's messages are clear, and it is not necessary to place them all here.
If the DNS resolver is configured with its own IP address and the
DNS server is not running locally, the Active Directory
Installation Wizard can install and configure the local DNS
server. However, if this server is not connected to the network
during domain controller promotion then admin needs to
appropriately configure root hints of the local DNS server after
the completion of the domain controller promotion.
Do not forget that you should also test the DNS configuration (registration of the SRV
records) after the server promotion has been completed.
There are two ways to start the Active Directory Installation Wizard in interactive
mode:
Choose the Start | All Programs | Administrative Tools | Configure Your
Server Wizard command, and then assign the domain controller role to the
server.
Open the Run window and enter dcpromo.exe.
In general, you have four options for installing the Active Directory; these are
graphically represented in Fig. 5.1. (Installation from a backup media is described
later in this chapter.) The selections, which you should consequently make on the
wizard's pages[1], are listed below for each option:
1. The first Active Directory installation in the network, or creating a new forest:
o Domain controller for a new domain
o Domain in a new forest
Note Creating a new forest is the only option that does not require any existing
domain (or domain controller). In all other cases, the Schema and the
Configuration partitions are replicated from a source domain controller
located in either an existing domain (for an additional DC), the parent (for
a child domain), or the root domain (for a new tree). Even if you are
installing a Windows .NET-based DC from backup media, some other
domain controllers must be accessible (dealt with later in this chapter).
Depending on the selected option, the wizard will ask you to enter a domain name. It
can be the name of an existing domain, parent domain, or forest root domain. In
Windows 2000, it is always recommended that you specify a DNS name because
DNS name resolving must already be operational at this stage. (Although the wizard
can sometimes accept NetBIOS domain names, this does not guarantee successful
execution of the subsequent Active Directory installation steps.) In Windows .NET,
you simply have no alternatives.
Caution During the next step, you must specify the domain NetBIOS name. You can
choose a name different from the one offered by default if you like (e.g., if
the DNS domain name is net.dom, then the default NetBIOS name will be
NET). If Service Pack 1 or later is not installed on a server running Windows
2000, you will get an error when publishing a printer in Active Directory (see
Chapter 8, "Common Administrative Tasks").
Note During Active Directory installation, synchronization with existing domain
controllers is carried out. It is possible to stop that process by clicking the
Finish Replication Later button in the wizard window. The domain controller
will be advertised when the replication is completed (after the computer has
been rebooted).
DNS Issues
In Windows .NET, the Active Directory Installation Wizard will stop if a preferred DNS
server address is not configured on the computer and you simply will not be able to
continue with Active Directory installation.
In Windows 2000, the message shown in Fig. 5.2 may appear at a certain moment
during the execution of Active Directory Installation Wizard. It means one of the
following:
There is no DNS server in the network (you are going to install the DNS server
and the domain controller on the same server).
No address or an incorrect preferred DNS server address has been entered in
the computer's TCP/IP Properties window. (This is a configuration error that
the system identifies as the absence of a DNS server.)
There is no authoritative zone for the new domain on the specified DNS
server.
Fig. 5.2: This window displays warnings about potential problems with the preferred
DNS server
The warning window will not appear if a DNS server address has been entered
correctly and the authoritative zone has been configured on this server. However, this
zone may not allow dynamic updates. In such a case, the wizard page "Configure
DNS" (Fig. 5.3) will be next. A similar window will appear on a Windows. NET server
that has no preferred DNS server and is promoted to be the first forest domain
controller.
Fig. 5.3: At this point, you must decide whether or not to install the DNS server
This step is a critical point in the installation process, because whether the new
domain configuration will work or not depends on what you do here. You only have
three options:
Click Cancel, which will terminate the wizard, and verify the DNS
configuration. You must select this option if the promoted server is not the first
controller in the domain (forest). If you do not, the Active Directory installation
on this server will definitely be unsuccessful: the server will not be able to
locate other domain controllers and replicate the Active Directory information
from them.
Agree with the default option and install the DNS server and domain controller
on the same computer.
If you are using a legacy DNS service and have the required sub-zones
delegated to a DNS server that allows dynamic updates, select the No, I will
install and configure DNS myself option and continue the Active Directory
installation.
You may also refuse the default option and continue the installation process if the
promoting server is the only DC in the network and if for some reason, you are
planning to connect it to a fully configured DNS server only after installing Active
Directory and before the first DC reboot. This approach may not seem very logical,
but is technically quite possible. When the domain controller boots for the first time, it
will register all necessary resource records on the DNS server (but in the forward
zone only, since the wizard does not create a reverse zone).
And only if the DNS configuration fully meets all the necessary requirements, you will
not see any of the wizard pages described above, and the wizard will go onto the
subsequent steps.
Fig. 5.4: DNS diagnostics reveal name resolution problems for a future domain
controller
If you add a DC to an existing domain and the wizard could not get the DNS name of
a DC located in that domain, you will see a window similar to the one shown in Fig.
5.5. The domain name (net.dom) as well as the preferred DNS server address
(192.168.1.2) are displayed here, and should be verified.
Fig. 5.5: Failed DNS diagnostics for a server promoted to be an additional domain
controller
Fig. 5.5 illustrates an example of a successful DNS test. Normally, every promotion
operation should be completed with a similar result. In such a case, you can be sure
that the new domain controller will not have name resolution problems.
After completing the Active Directory installation, the system automatically installs
and configures the Windows DNS Server if this operation has been requested.
After system restart, you can logon to the created domain with the local administrator
credentials. The local administrator of the server that has been promoted to the first
domain controller in a new forest will become a member of the following groups:
On Windows .NET domain controllers, the Everyone group does not include the NT
AUTHORITY\ANONYMOUS LOGON group. Therefore, if backward compatibility is
required, add both security groups to the Pre-Windows 2000 Compatible Access
group.
You can manage backward compatibility during a server promotion (by selecting the
appropriate permissions option), as well as at any moment (manually, by using the
net localgroup command).
Log Files
The events that have taken place during Active Directory installation are written in the
logs located in the %SystemRoot%\Debug folder (and are especially useful if the
installation has crashed):
csv.log
DCPROMO.LOG
dcpromohelp.log
dcpromoui.log
NetSetup.LOG
NtFrs_xxxx.log
NtFrsApi.log
Installation from a Backup Media
A Windows .NET server can be promoted using the System State data from an
existing Windows .NET domain controller. (Such a feature is absent in Windows 2000
domains.) This approach considerably reduces the initial replication time if slow dial-
up lines are used or the Active Directory database is large enough. However, the
promotion process still requires network connectivity with the existing domain!
The only restriction of this approach is that the replicas of any application partitions
existing on the backed up domain controller will not be created automatically on the
new DC. You should manage the application partitions manually (see the NTDSutil
description in Chapter 10, "Diagnosing and Maintaining Domain Controllers").
1. Backup the System State of a DC located in the domain where you are
creating an additional DC. Make sure that the Automatically backup System
Protected Files with the System State box is cleared (you do not need the
system files!). (See additional information on system backup in Chapter 8,
"Common Administrative Tasks.")
2. Copy the backup file to the server that is to be promoted.
3. Restore the System State data to any empty folder on the target server.
4. To do so, start the NTBackup utility, click Catalog a backup file on the Tools
menu, and enter the backup file name. Check the System State box, select
Alternate location from the Restore files to list, and enter the target folder
name (Fig. 5.7). Click Start Restore. In the Confirm Restore window, click
OK.
5. When the restore operation is completed, enter dcpromo /adv in the Run window
(click Start | Run). The Active Directory Installation Wizard will start.
6. On the "Domain Controller Type" wizard page, select the Additional domain
controller for an existing domain option and click Next. If you select the
other option, a normal DC creation procedure will begin.
7. On the "Copying Domain Information" page, select the From these restored
backup files option, enter the backup file name, and click Next.
8. If the System State was backed up from a DC that was a Global Catalog
server, the wizard will ask you whether to configure the new DC as a GC
server ("No" by default).
Missing part
There are two main problem sources that can prevent domain members running
Windows 2000/XP/.NET from correctly joining or working with a domain:
DNS
Windows Time service
This result indicates that you can add the tested computer to the specified domain.
When a client computer is already added to a domain, you may verify that this
operation has been successfully completed. Both command — netdiag /test:DsGetDc
and netdiag /test:DcListx — should run successfully. The following example indicates
that problems exist: the command reports that for some reason the client cannot
access the DC:
Make sure that the primary DNS suffix is properly set. (It is enough if the Change
primary DNS suffix when domain membership changes checkbox is always set;
in that case, the suffix is changed automatically and you need not worry about it.) An
improper value may affect DNS registration of the computer name, which results in
various errors, such as a failed secure channel, authentication problems, etc.
When a Window XP/.NET client computer is deleted from a domain, its primary DNS
suffix will be cleared, and as a result, its name is de-registered from the domain's
authoritative zone. The primary DNS suffix will remain on clients running Windows
2000 and therefore, the computer name will still be present in the domain zone,
whereas the computer itself no longer belongs to that domain.
or
When the TCP/IP settings are incorrect on a Windows XP/.NET computer, or the
specified domain is not accessible, you will see a pop-up window similar to the one
shown in Fig. 5.5. A Windows 2000 computer will report, "The specified domain
either does not exist or could not be contacted". If this happens, you will need to
check the computer network configuration and accessibility of domain controllers
(see later "Verifying DNS and Availability of Domain Controllers").
DC discovery test
DC list test
Trust relationship test
Kerberos test (skipped with a diagnostic message "Cannot find DC")
LDAP test
Therefore, it is always recommended that you verify the computer's DNS settings if
the computer experiences problems such as slow system startup or access to shared
resources; improper group policies applied; failed start of domain administrative tools,
and so on.
When you add a Windows XP/.NET client to a domain, the client computer will then
periodically synchronize its clock with the PDC Emulator of that domain. The register
value Parameters\Type that controls the Windows Time service and is set by default to
NTP, will be changed to NT5DS (see details in Chapter 2, "Active Directory
Terminology and Concepts"). The following command will help you to see the
computer time offset and the name and IP address of a domain controller that serves
as the timeserver:
C:\>w32tm -source -v
Note Windows 2000 and Windows .NET systems have different versions of the
W32tm utility. Therefore, you need to select the appropriate parameters for the
version that you happen to be using.
You may, for some reason, need to have the Windows NT 4.0-based Backup Domain
Controllers (BDC) in a Windows 2000/.NET domain. The only problem that may (or
rather, will) arise during the BDC installation is that the Windows NT 4.0 Setup
program creates the wrong type of account. A pop-up window with the following error
message will appear:
The Machine Account for This Computer either does not exist or is
inaccessible.
If, for example, the account NT4BDC5 was used when installing BDC, the following
error will be registered in the System log on the Windows 2000- or Windows .NET-
based domain controller that owns the PDC Emulator FSMO role:
...
Event Source: SAM
...
Event ID: 12298
...
Description:
As a result, you will not be able to proceed with the BDC installation. See the
instructions below.
To pre-create a computer account for a Windows NT 4.0 BDC, log on to the domain
using an administrative account on any Windows 2000 domain member, and perform
the following operations:
1. Start the Server Manager (enter srvmgr at the command prompt), which is
supported with Windows 2000. (Do not use the Server Manager from the
Windows NT 4.0 installation!)
2. Select Add to Domain from the Computer menu.
3. Select Windows NT Backup Domain Controller, enter the BDC computer
name, and click Add, then Close. A "Windows NT Backup" type account will
appear in the computer list. The account will be created in the "default"
Domain Controllers OU.
Then you can install a Windows NT 4.0 server as BDC. Or, if the BDC was already
installed, it may be necessary to use NetDom.exe to reset the computer account
password.
The following operations will yield the same result as described above:
1. Open the Active Directory Users and Computers snap-in and create a
computer object in any container.
2. Start the ADSI Edit snap-in, find the userAccountControl property (decimal
INTEGER type; see ADS_USER_FLAG_ENUM in the ADSI SDK) for the new
computer object, and change the value from 4128 (0x1020 —
WORKSTATION_TRUST_ACCOUNT) to 8192 (0x2000 —
SERVER_TRUST_ACCOUNT).
The third way to create a computer account for a BDC is to install the Support Tools
pack and enter the following string at the command prompt (this command does not
work on Windows .NET domains!):
To add a Windows NT 4.0 BDC to a Windows .NET domain (that should run at the
Windows 2000 mixed functional level!), use the following operations:
1. Open the Active Directory Users and Computers snap-in and select any
applicable container.
2. Select the New | Computer command from the Action menu.
3. Enter the computer name and set the Assign this computer account as a
pre-Windows 2000 computer and Assign this computer account as a
backup domain controller checkboxes. Click OK.
4. Install a Windows NT 4.0 server as BDC or continue a failed installation.
If there isn't a Windows NT 4.0 BDC in a Windows 2000 domain, this domain can be
switched from the default mixed mode to native mode. In Windows .NET domains,
the "functional level" term is used in such a case. You can raise the domain
functional level to a level that depends on the types of domain controllers used in the
domain. If there are no Windows NT 4.0- or Windows 2000-based domain controllers
in the entire Windows .NET forest, it is also possible to raise the forest functional
level (see details in Chapter 2, "Active Directory Terminology and Concepts").
Remember that only the type of controllers located in a domain affect the domain
mode or level; the domain clients (with or without Active Directory client software) will
"see" this level of functionality of an Active Directory domain (see Chapter 2, "Active
Directory Terminology and Concepts" for just about the only exception.)
In the Windows 2000 environment, select a domain and open its Properties window.
Click the Change Mode button on the General tab and wait 15 minutes for
replication of the changes to all DCs in the domain. Operations in the Windows .NET
environment will be described in the "Raising Functional Level" section in Chapter 7,
"Domain Manipulation Tools."
To check that the domain is now in the native mode (or at a higher level), you may try
to create a universal group or to add a domain local group to another local group.
Creating inter-domain trusts is a rather simple operation if one understands the trusts
mechanism used in Active Directory. The Active Directory Domains and Trusts
snap-in is used for all work with any trusts in Active Directory domains. You can
easily select domains in the snap-in's tree window and look up existing trusts.
However, to verify, create, or remove trusts, you must provide the credentials of a
user that has privileges to modify trusts.
Let us discuss various trust types by using a sample domain structure shown in Fig.
5.10.
Fig. 5.10: A sample domain structure that illustrates various trust types
net.dom — the forest root domain that has a Child relationship with its child
domain.
subdom.net.dom — a child domain that has a Parent relationship with the root
domain.
net2.dom — a tree root domain that is connected with the Tree Root
relationships with the forest root domain.
All of the above-mentioned trusts have been created automatically; they are transitive
and two-way. You can, for example, logon to the subdom.net.dom domain (i.e., you
can specify a user account located in that domain) on a computer that belongs to the
net2.dom domain. To speed up the authentication process, you may want to create
an explicit one-way or two-way trust between these domains:
The subdom.net.dom and net2.dom domains are also connected with a trust
marked as Shortcut (shown only for the net2.dom domain).
You are also able to establish trust relationships (one- or two-way) with other Active
Directory forests or Windows 4.0-based domains:
In addition, Windows .NET-based forests that operate at the Windows .NET (version
2002) functional level can be linked with the Forest transitive relationships:
dotnet.dom — a forest root domain that has two-way forest trusts with the
net.dom forest
Figs. 5.11 and 5.12 illustrate all listed trust types as they are represented in the
Active Directory Domains and Trusts snap-in.
Fig. 5.12: The shortcut trust between two domains within the same forest
Note Keep in mind that any trusts are always possible between Windows NT 4.0,
Windows 2000, and Windows .NET domains, regardless of the mode in which
the Active Directory domains are working.
Only shortcut, external, or forest trusts can be removed. You cannot delete
"default" (Parent-Child and Tree Root) trusts by using the Active Directory
Domains and Trusts snap-in or other tools. This can only be done by
removing the appropriate domain or tree.
The state of all existing trusts can be verified. Select the desired trust on the Trusts
tab (see Fig. 5.11); click Properties, and then Validate[1]. Normally, you will get the
message: "The trust has been verified. It is in place and active". You may be asked
for additional credentials in another domain (e.g., if you test the "parent-child" trust
from a child domain, you will be asked for credentials in the parent domain).
Basically, the trust creation process is the same on all platforms: for a one-way trust,
you should first create an outgoing trust in the trusting domain, and then create the
corresponding ingoing trust in the trusted domain. For a two-way trust, this process
should be executed twice: it is necessary to create both outgoing and ingoing trusts
in each domain. For the sake of simplicity, we will discuss trust creation in a Windows
.NET domain only.
For a Windows .NET domain, the trust creation process is simplified, since the wizard
allows you to create any trusts in both domains simultaneously (in that case, you
must specify the appropriate credentials in both trusting and trusted domains).
To discuss the trust creation in detail, let us use a sample domain structure shown in
Fig. 5.10. In this structure, you may create a shortcut to speed up the access from
the net2.dom to the resources located in the subdom.net.dom domain. The
subdom.net.dom domain (the trusting domain) will then trust the net2.dom (the
trusted domain).
Within a forest, users can log on to any forest domain on computers that can belong
to any domain in the same forest. This is possible due to transitive Kerberos trusts
existing within the entire forest. However, before a shortcut trust is created, there is
no direct trust between the net2.dom and subdom.net.dom domains, and the
authentication process should run over all domains that have direct trusts and
connect these two domains. A shortcut trust can speed up this process.
All direct trusts can be verified with the NLtest command. Initially, this command fails
on a DC in the subdom.net.dom domain (because there is no direct connection
between the current and specified domains, and there are no trusted servers in the
net2.dom domain):
C:\>nltest /sc_query:net2.dom
I_NetLogonControl failed: Status = 1355 Ox54b ERROR_NO_SUCH_DOMAIN
To create a shortcut trust:
1. Open the Active Directory Domains and Trusts snap-in, select the trusted
domain (net2.dom), and open the Properties window.
2. Click New Trust. The New Trust Wizard will help you to do all preliminary
work to create trusts of any type. Click Next.
3. Enter the name of the trusting (or target) domain (subdom.net.dom) and click
Next.
4. On the next wizard page (Fig. 5.13), you should select the trust direction. By
default, the wizard suggests that you create a two-way trust (therefore, the
domain selected earlier will be both a trusting and trusted domain). However,
in our case, it is necessary to choose the second option — One way:
incoming. Then click Next.
5. The next wizard page (Fig. 5.14) will appear on Windows .NET-based DCs
only. If the target domain is based on domain controllers running Windows
2000 or Windows .NET, you can create the trust in both domains at the same
time. You should only provide the appropriate credentials for the target
domain.
Fig. 5.14: You can create a trust in either the local domain only or both
domains at the same time
If the other "half" of a trust is a Windows NT 4.0 domain, you can create it in
the local domain only; the other side of the trust must be created on a DC in
the trusting domain by an administrator or a user that has trust creation
privileges in that domain. (Windows NT 4.0 does not support system calls
necessary for the "remote" trust creation.)
If you leave the default option, the wizard will ask you for the trust password
on the next step. This password is an arbitrary character sequence, which you
must reproduce when the other side of the trust is created on the target
domain.
6. On the next wizard page, you need to enter the credentials of a user with
appropriate privileges in the trusting (target) domain and click Next.
7. All selections are complete now. Click Next.
8. If the selections have been made properly, you will see the "Trust Creation
Complete" wizard page. Click Next.
9. On the next wizard pages, you may confirm the creation of outgoing and
incoming trusts. This is only necessary if you have selected the trust creation
in both domains. Otherwise, the trust must be created first in the trusting
(target) domain. Skip the confirmation steps if the other side(s) of the trust has
not been created yet.
10. On the last wizard page — "Completing the New Trust Wizard", you will see
the report on operations performed. Close the wizard by clicking Finish.
That is all. A one-way transitive trust has been created. (The trusts with foreign
forests or domains will not be transitive!) You can check it by using the NLtest
command. After the trust has been created, you should see:
C:\>nltest /sc_query:net2.dom
Flags: 30 HAS_IP HAS_TIMESERV
Trusted DC Name \\netdc4.net2.dom
Trusted DC Connection Status Status = 0 0x0 NERR_Success
The command completed successfully
This means that the displayed DC in the trusting domain will authenticate the
requests from DCs in the net2.dom domain.
You may also establish a two-way trust, in which both domains will trust each other.
To create the trust in the reverse direction, repeat the procedure described above,
but this time start from the other domain in the pair (in our example it would be the
subdom.net.dom domain). It does not matter from which domain — trusted or trusting
— one begins to create a trust. The main thing to remember is that every trust has to
be created on both sides of a domain pair, and you must use the same trust
password.
Fig. 5.15: You can delete a trust from either local domain only or from both
domains at the same time
If you have deleted the trust in the local domain only, do not forget to delete it from
the other domain, too.
If the trusting domain in the example discussed in the previous section were a
Windows NT 4.0-based domain (named, let us say, NT4DOM), the necessary steps
would look like this:
1. Start the User Manager for Domains, and select the Policies | Trust
Relationships command.
2. Click Add (to the right of the Trusted domains panel).
3. Enter the NetBIOS (pre-Windows 2000) name of the trusted domain (NET2)
and the trust password entered in Step 5 (see above). Click OK.
4. Normally, you will get the message: "Trusted Relationship with ('NET2' for our
example) successfully established".
Note You must establish two-way trusts between domains for migrating from a
Windows NT 4.0/2000/.NET domain to an Active Directory domain (which must
be in the native mode or higher) by using the Active Directory Migration Tool
(ADMT), ClonePrincipal, or similar (third-party) tools.
The forest trusts are always transitive and can have a one-way as well as two-way
direction. Remember that the forest functional levels of both forests must be raised to
Windows .NET (version 2002)! If this condition has not been met, you may create a
usual external trust only. Make sure that domain controllers of each forest can
resolve the DNS name of another forest.
1. Open the Active Directory Domains and Trusts snap-in on any DC in the
forest root domain of either forest that participates in the forest trust. (The
forest root domain is preferred, because you should run this snap-in with the
administrative privileges in that domain.)
2. Open the Trusts tab in the Properties window of the forest root domain
(net.dom in our example) and click New Trust.
3. On the "Trust Name" wizard page, enter the DNS name of another forest's
root domain (dotnet.dom). (If you select any other domain names, the page
shown in Fig. 5.16, will never appear!)
Fig. 5.16: This page allows you to create a transitive forest trust
4. If you leave the default option on the "Trust Type" wizard page (Fig. 5.16), you
will be able to create a usual external trust only. Therefore, select the lower
option (Forest trust) and click Next.
5. On the next page (see an example in Fig. 5.13), select the direction of the trust
and click Next.
6. Then, select the sides of the trust (see Fig. 5.14). Click Next. Enter credentials
of a user with appropriate privileges, if necessary.
7. A very important selection should be made on the next wizard page (Fig.
5.17). (The good news is that it is possible to change this selection at any
moment in the future.) By default, all users from the target forest will be able to
access those shared resources in the local forest that are available for the
Everyone group. Otherwise, you should grant the permissions manually.
Fig. 5.17: On this page, you will select the authentication scope for users from
the target forest
If the created trust is two-way, a similar page will appear for the target forest,
too. For an already created forest trust, you can open its Properties window
and manage the authentication scope on the Authentication tab.
Now, it is possible to grant permissions and privileges to any user within either forest.
For example, if you want to select an applicable user account and will open the
Locations window (Fig. 5.18), you will see any domains and forests that trust the
current domain. However, an external forest w2000.dom connected with non-
transitive trusts is shown as a usual domain, whereas the dotnet.dom forest is shown
as a domain tree, which means that it is possible to choose accounts from the entire
forest.
Fig. 5.18: This window displays all external forests
[1]
In Windows 2000, the corresponding buttons are named Edit (funny enough, you
cannot edit anything in the appropriate window) and Verify.
In this chapter, all considerations of Active Directory domains cover both Windows
2000 and Windows .NET domains unless otherwise noted.
Every Active Directory beginner first gets a piece of good news: all Active Directory
domain controllers (running either Windows 2000 or Windows .NET) are peers; write
operations are permitted on every domain controller (DC); and all changes are
replicated from the originating DC to others (so-called multi-master replication is
used). These features are quite advantageous when compared to the rules accepted
in Windows NT-based domains.
Some time later, the beginner gets some bad news: there are operations when some
DCs perform additional functions (i.e., in comparison with other DCs), and instead of
the one role available for a DC in Windows NT-based domains — either Primary
Domain Controller (PDC) or Backup Domain Controller (BDC)—an Active Directory
domain controller can simultaneously perform up to five different roles[1]. These roles
are known as Flexible Single-Master Operation (FSMO) roles. (You can easily find a
description of each role in the Help and Support Center. Open the Index tab and
enter FSMO as the keyword, or use the Search tab. See also the "Managing FSMO
Roles in the Forest" section in Chapter 8, "Common Administrative Tasks" and the
"How to Find an FSMO Master?" section in Chapter 17, "Scripting Administrative
Tasks.")
Fig. 6.1 illustrates the default placement of FSMO roles within a forest. As you can
notice, every first DC created in a domain holds three domain-wide roles; and in
addition, the first DC located in the forest root domain holds two forest-wide roles.
There are many guidelines for placing FSMO roles; we will consider only a few rules
that you should not violate:
Notwithstanding the fact that the Primary Domain Controller (PDC) Emulator in
Active Directory domains does not play as important a role as the PDC plays
in Windows NT domains, you must carefully assign this role. Even in the
native mode Windows 2000 domains or Windows .NET (version 2002) level
Windows .NET domains, the PDC Emulator is used as a primary authority for
updating user passwords and controlling failed authentication requests.
By default, the PDC Emulator is selected by the Group Policy Object Editor
snap-in, and you may have trouble editing group policies if the PDC Emulator
is inaccessible. Keep the PDC Emulator and Relative Identifier (RID) Master
role on the same DC. However, keep in mind that these two roles can produce
a considerable workload on that DC.
All DCs in a domain will synchronize the clock with the PDC Emulator. In a
multiple-domain forest, the PDC Emulator from each domain will synchronize
the clock with the PDC Emulator located in the forest root domain. The forest
root PDC Emulator should synchronize its clock with an external time source.
If a domain has two or more DCs, the Infrastructure Master and a Global
Catalog (GC) server must not be placed on the same DC; however, they need
to be connected by a high-speed link to reduce network traffic. (You can
ignore this requirement if there is only one DC in a domain, or if each DC in a
domain is the GC server.) It is advisable to deploy at least one GC per site.
(You may also consider universal group membership caching available in
Windows .NET domains.) However, it is not typically recommended that you
designate all DCs in the domain as GC servers, since this produces additional
network traffic.
Place both per-forest roles — Schema Master and Domain Naming Master on
the same DC. In Windows 2000, assign this DC as a GC server; this is not
required, if Domain Naming Master runs on a Windows .NET-based DC. This
is mandatory to guarantee the uniqueness of names in the forest.
By default, the first DC installed into a domain owns all of the domain
operations master roles. If you remove Active Directory from this domain
controller, all roles are automatically transferred to another available DC. If the
demotion process fails, you must manually seize the operations master roles.
As a "best practices" rule, you might consider manual transferring of any roles
before demotion of a DC. (See the description of the NTDSutil tool in Chapter
10, "Diagnosing and Maintaining Domain Controllers.") If the demoting DC is a
GC server, you must first be sure that there are other GC servers in the forest,
and then designate a new GC server if necessary.
If you restore a DC that owns some FSMO roles, these roles will be also
restored. Therefore, you may need to review all current role owners after the
restore is completed.
[1]
In fact, this number may even increase if one takes into consideration the fact that
the Infrastructure Master role also exists for each created application directory
partition.
Replication Issues
The concept of the site that has appeared in Active Directory domains significantly
affects the methods of replicating directory partitions (within a site and between sites)
as well as the replication transports (protocols).
Replication Transports
The following table lists the rules applicable to the various transports used for
different types of replication:
Between sites
Directory partitions Within a site
The same domain Different domains
Domain Naming context RPC over IP "IP" (RPC over IP) –
Configuration "IP" (RPC over IP) "IP" (RPC over IP)
Between sites
Directory partitions Within a site
The same domain Different domains
Schema or
"IP" (as accepted in the Active Directory Sites and Services snap-in) enables a
low-speed, point-to-point, synchronous replication for all directory partitions.
"SMTP over IP" provides low-speed, asynchronous replication between sites and
supports only Configuration, Schema, and Global Catalog replication; requires
installation of an enterprise Certification Authority (CA).
There are two default methods of replicating object changes in Active Directory
forests:
Urgent Replication
Certain events on DCs are replicated immediately rather than at predefined intervals.
This is known as urgent replication. The following events on any domain controller
trigger urgent replication between DCs in the same site:
Setting an account lockout after a certain number of failed user logon attempts
Changing a Local Security Authority (LSA) secret
Changing the RID Master FSMO role owner
(If a change notification is configured between sites, the urgent replication can be
propagated to other sites.)
Urgent replication in Active Directory domains is not initiated by the following events:
A Group Policy Object (GPO) consists of two parts. One part is located in Active
Directory (the DS part), and the other part is stored on the hard disk in the SYSVOL
volume (the Sysvol part). Hence, GPOs are replicated in two ways: by normal Active
Directory replication and by File Replication Service (FRS). If one replication
completes successfully, this does not mean that there are no problems with the other
replication. That is why you should monitor the consistency of GPOs. For that
purpose, use such tools as Active Directory Replication Monitor (ReplMon.exe) (see
a server's Status Report) or GPOTool.exe that display the DS version and the Sysvol
version separately for each GPO. (See detailed description of GPOTool.exe in
Chapter 15, "Group Policy Tools.")
Monitoring Replication
You may wish to monitor replication events both in a test and a field environment.
(The only difference may be in the level of detail given for registering events.) To
fulfill this task, it is possible to use the event logs and performance counters.
You can use the Directory Service event log for monitoring such events as the
moments of replication request completion, the number, total size, and names of
replicated attributes, and so on. The granularity level of logged events is set through
the system registry (see below).
To see replication events, set the registry value to at least level 3. Level 4 allows you
to track replication of each changed attribute. (Use this level for debugging only!
If many objects are replicated, the number of events in the Directory Service log may
be huge. This also significantly affects the performance of the DC.) You can easily
find all replicated data by the Event ID. A message (ID 1239) similar to the following
is written in the log for all unchanged attributes of the replicated objects:
If an attribute was changed, it is replicated to another DC, and a message with the ID
1240 will appear in the log:
Performance counters are very useful to monitor replication events, especially the
replication traffic. To start monitoring, run the Performance snap-in (from the
Administrative Tools group). Select System Monitor and click the Add button on the
taskpad. Select NTDS in the Performance object list and add the counters shown in
Fig. 6.1.
(The Report View seems to be the most useful in this case.) All counters have zero
values immediately after startup of the DC. (The NTDS performance object has a
great number of counters, and I have selected only some of them that are related to
replication.)
Fig. 6.2: Some of the performance counters important for monitoring replication
Note As you can see in Fig. 6.1, compression of replication traffic (both inbound and
outbound) can reach a ratio 12 to 1 (ratios up to 20 to 1 are also possible). If
the replicated block of information is not large enough (less than 32 Kbytes),
compression of inter-site traffic is not carried out.
You can also create a custom MMC console that will contain a copy of the System
Monitor Control for each selected domain controller. (Start an MMC console, select
ActiveX Control in the Add Standalone Snap-in window, and find the System
Monitor Control in the Control type list. Repeat this procedure for each desired DC.
Then, select the performance counters from different DCs and add them to the
appropriate ActiveX controls.) See also the "Managing Replication" section in
Chapter 11, "Verifying Network and Distributed Services."
The DRA Sync Requests Successful value must normally be equal to the DRA Sync
Request Made value. However, these values usually differ on the DC(s) booted first,
when its replication partners may yet be non-operational. Remember the values
when all DCs in the network are online and replicated. From that moment on, the
difference between these values must not increase.
When the default level 0 is set, only critical events are logged. This is the normal
value for most entries. "Super-verbose" level 5 should be used with care, since it
causes all events to be logged and is only used for debugging specific problems. If
you have encountered an Active Directory-related problem, try to slightly increase the
value of the appropriate registry value and to reproduce the problem. Do not forget to
restore the default value after the problem has been solved.
There are no strict rules for selecting an entry value. You can do this in an
experimental way. Use of the Replication Events entry has been discussed above. If,
for example, the value of the Garbage Collection entry is set to 3, you can see when
the garbage collection starts and completes, as well as the volume of free space in
the directory database file. When the value is set to 5, each object deletion will also
be logged.
There is a kind of replication error that happens when a specific object "prevents" a
replication request from being completed. (Remember that you cannot simply delete
this object, since deleted objects are also replicated.) The Q265090 article from the
Microsoft Knowledge Base describes troubleshooting similar errors that may appear
during the replication phase of the server promotion process. A similar approach can
also be used for other cases of internal errors related to replication. (You can also
consider this article as an example of troubleshooting replication issues.) To solve
the problem, you should delete the interfering object, decrease the tombstone lifetime
to the lowest value possible (2 days), and wait until the garbage collection entirely
deletes the object. In Windows 2000, this trick has saved my network a few times,
when all other means did not help at all. Windows .NET systems seem to be more
proof against similar problems.
Verifying an Active Directory Server Status
As you know, a server running Windows 2000 or Windows .NET systems can
advertise itself as a domain controller (if it has been promoted to perform such a
role), and an Active Directory domain controller can also advertise itself as a Global
Catalog (GC) server. There are quite a few cases when you may wish to be sure that
this process has been successfully completed.
For example, if the File Replication Service (FRS) encounters some trouble, it does
not initialize the system volume, and the Netlogon service thus cannot share the
SYSVOL volume. (The NETLOGON volume also cannot be shared in that case.) This
results in problems with applying group policies, as well as many other replication
and authentication problems.
Here are the methods that will allow you to identify whether a Windows 2000- or
Windows .NET-based server is a domain controller after its promotion or normal
reboot:
Assigning a domain controller as a Global Catalog server (for example, in the Active
Directory Sites and Services snap-in) and advertising this DC as a GC server are
not the same things. A domain controller can advertise itself as a Global Catalog
server only after it has replicated in all domain partitions existing in the forest at the
moment.
You can use the following methods to verify advertising of a DC in the role of Global
Catalog server:
After a DC has been promoted to a GC server, the event with ID 1110 (Event
Source: NTDS General; Event Category: Replication) appears in the Directory
Service log. The advertising process completes with the ID 1119 event: "This
domain controller is now a global catalog."
The Global Catalog Promotion Complete registry value under the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters key
must be equal to 1.
Use Ldp.exe to view the isGlobalCatalogReady attribute of the RootDSE
object. (For more information, see Chapter 1 and Chapter 12.)
Use NLtest.exe. (More details are in Chapter 11.)
This chapter unveils certain aspects involved in using the features of the
administrative tools for managing Active Directory. Other typical administrative tasks
carried out by these and other tools will be discussed in Chapter 8, "Common
Administrative Tasks," and in other chapters, where specific tasks are described in
detail.
Basic Active Directory Administrative Snap-ins
Both Windows 2000 and Windows .NET systems use the same set of snap-ins for
administering Active Directory. For the most part, these tools have not changed in the
new version; they perform the same fnctions (although in Windows .NET, all of them
have some additional features). Therefore, an administrator acquainted with
Windows 2000-based domains can easily master commonly used operations in the
Windows .NET environment.
After a Windows .NET Server has been promoted to a domain controller, new tools
(listed in Table 7.1) will appear in the Administrative Tools group on the Start
menu.
container.
These tools can be installed as a part of the Administration Tools Pack (see "Remote
Administration" in Chapter 8, "Common Administrative Tasks") onto any client
computer with Windows XP Professional or a member server with Windows .NET.
The Security Policy snap-ins will not appear on the Start menu in that case.
Note The Active Directory Schema Manager snap-in included in the Administration
Tools Pack is also installed on domain client computers and appears on the
Start menu.
Important It is not possible to install Windows .NET administrative snap-ins onto
Windows 2000-based computers.
Some other important tools (Table 7.2) for administering Active Directory are included
in the Support Tools pack. These tools might be regarded as mandatory for an
administrator, and are discussed later in this book.
Table 7.2: Some Additional Tools for Maintaining Active Directory (from Support
Tools)
Icon Tool name Main operations performed by the tool
Since most Active Directory administrative tools have been realized as MMC snap-
ins, all of them have similar interfaces and basic features. Knowing these features
allows you to use all of these tools in the most effective way possible, and to optimize
them to fit your specific tasks. Sometimes, a snap-in's design and features may even
affect some aspects of deploying Active Directory in an enterprise (see a bit later in
this chapter "Choosing Columns for Displaying"). Let us start by discussing
administrative snap-ins, taking into consideration some common features of snap-ins.
Most standard administrative tools can be started from the Start | Administrative
Tools menu, or can be added to a custom MMC console. Such tools as the Active
Directory Schema Manager snap-in or the Group Policy Object Editor snap-in
should always be initially added to an MMC document:
Making your own administrative console may have some valuable advantages:
You will have on hand all the instruments you want, which will be configured to
your discretion. For example, you may have snap-ins connected to different
domains, or Group Policy Object Editor snap-ins linked to various GPOs.
There will be more options for configuring and customizing snap-ins (see in
this chapter "Customizing Snap-ins").
The computer's memory is used more efficiently. A number of tools started
separately allocate considerably more memory than the same tools added to a
single MMC console.
While working in a snap-in window, don't forget about such simple but timesaving
web-style features on the Standard toolbar as the Forward and Back buttons,
the Up one level button, and the Refresh button. When pointing to an object,
you can view its properties either by selecting the Properties command in the
context menu, or — to do it faster — by clicking the Properties button.
Choosing Columns for Displaying
When working with different Active Directory objects, it is possible (and may be very
helpful) to display more fields than just the three default ones, or to delete
unnecessary ones. Select the Add/Remove Columns (in Windows 2000 — Choose
Columns) command in the View menu, and add or delete the necessary columns in
the Add/Remove Columns window (Fig. 7.1). Each object will have its own set of
fields.
In Fig. 7.1, note that in MMC v.2.0 you can move any item to the beginning of the
Displayed columns list. In Windows 2000, the Name item is always at the top.
Note When the Active Directory Users and Computers snap-in is used for creating
new users, the Full Name field is generated as a concatenation of the First
name and Last Name fields. The Full name field, in turn, determines the value
of the cn attribute. (You can, however, change this order, if you like — see
articles Q250455 and Q277717 in the Microsoft Knowledge Base.) You may
want, for some reason, to use proprietary naming conventions in your
organization. (This can be easily organized by using scripts or batch tools, such
as LDIFDE or CSVDE. Manual manipulations are also possible.) For instance,
you may wish for the cn attribute (i.e., the Full name field) to have the same
value as the sAMAccountName attribute (the Pre-Windows 2000 Logon Name
field) or as a proprietary ID code.
Note Sometimes, the Windows 2000 version of the Active Directory Users and
Computers snap-in does not sort a container contents on some columns. (In
Windows .NET, this is not an issue.) You can use the Find Users, Contacts,
and Groups window rather than the main snap-in's window. This window
allows you to sort rows according to the contents of any column. "Hide" the
Name column from view and rearrange the columns in the order most useful for
you. (It is not possible to remove this column in the main window. Moreover, in
Windows 2000, this column must always be first.) Click Browse to view the
forest tree and go to any location (then click Find Now). You can select the
most appropriate of the two windows depending on your requirements.
Exporting the List of Objects
To document the objects stored in Active Directory, you can export any currently
displayed list into a file for processing or printing from the Word or Excel applications.
Point to a container or an object and click the Export List button, or select the
Export List command in the context or Action menu. You can choose between tab-
separated (.txt) and comma-separated (.csv) formats. CSV files are easily imported
into Microsoft Excel documents.
Customizing Snap-ins
Standard configured administrative snap-ins lack certain useful features that are
realized in Microsoft Management Console (MMC) technology. These features are
common for all MMC consoles, and there are many reasons why using them in the
administrative tools allows an administrator to save a lot of time and effort.
Favorites
In a custom MMC v.1.2 console, the Favorites tab will appear near the usual Tree
tab. A MMC v.2.0 console has the Favorites command on the main console menu.
You can browse Active Directory in a web-like style, and save the pages you'd like to
access later. Point to any container in the Tree pane, and select Add to Favorites in
the Favorites menu. This feature can be very helpful in large domains that contain
many OUs and other objects.
Notice also that any container in Active Directory that can be viewed in different
snap-ins can be designated as a favorite; it will be placed in the same list of favorites.
You can, for instance, simultaneously have main OUs from different domains,
authoritative DNS zones, DHCP scopes, site connections, etc., all on the Favorites
tab (or on the Favorite menu—in MMC v.2.0). Do not forget about traditional
browsing features, such as the Back, Forward, Up one level, and Refresh buttons.
An administrator may create specialized taskpads for him—or herself (for some
routine tasks) as well as for users that need to carry out certain (limited) tasks, or for
subordinate administrators to whom control of some OUs or objects is delegated.
Select an OU in the Active Directory Users and Computers snap-in, and click New
Taskpad View from the Action menu. The New Taskpad View Wizard will be
started, which will guide you through all necessary steps. At any step of wizard
working, you can go back and change the selected options or entered information.
Leave the default options in the Taskpad Display and Taskpad Target steps
unchanged. This means that the tab of the created taskpad will appear for each OU
in the domain (but not for other domain containers!). Enter the necessary information
at the Name and Description step. When the wizard has finished (i.e., the view
without task buttons has been generated), check the Start New Task wizard box in
the last window and click Finish. The New Task Wizard will start.
The default Command Type is Menu command. In the Shortcut Menu Command
step, select Tree item task in the Command source list (Fig. 7.2). In this case, we
will be able to choose the commands for the entire OU. First, select New-
>Computer.
Fig. 7.2: Selecting the source of the commands for the new taskpad
At the next step, enter a relevant task name, and a description for this task. Then you
can choose a graphical representation (icon) for the task. A new task has now been
created. To add the other two commands, check the Run this wizard again box in
the last window of the wizard, and click Finish. The wizard will start again. Repeat
the necessary steps, the first time selecting New->User, and the second time—New-
>Group. Fig. 7.3 shows an example of a taskpad created according to the described
procedure.
Fig. 7.3: An example of a taskpad
You may add/delete tasks, and/or change the properties (options) of a taskpad by
selecting the appropriate tab and clicking Edit Taskpad View in the Action menu.
The Active Directory Users and Computers snap-in is perhaps one of the tools
that an administrator will use most often. That is why it is advisable to learn all of the
features that this snap-in provides for an administrator. This is especially true if a
domain contains thousands of objects, which complicates viewing and manipulating
them.
New Features
The Windows .NET version of the Active Directory Users and Computers snap-in
offers some new features:
The Active Directory Users and Computers snap-in operates with only one DC —
and, therefore, one domain — at a time. By default, this is your current logon domain
and DC (unless you have changed the domain or DC and checked the Save this
domain setting for the current console box, Fig. 7.4).
Fig. 7.4: You may choose any domain in the forest to administer
You can choose a domain that you wish to investigate by pointing to the root of the
snap-in (or by selecting the domain object from the tree pane) and then selecting the
Connect to Domain command in the Action menu. In the Connect to Domain
window enter the domain name in the Domain field, or click the Browse button and
select the domain from the expanding domain tree. Notice the Save this domain
setting for the current console box, which allows you to have a few saved snap-ins
configured for different domains.
Similarly, you can select any domain controller in the current domain with the
Connect to Domain Controller command in the Action menu. It makes sense to do
this when, for some reason (e.g., regarding a replication issue), you need to
administer a Global Catalog server, or a DC performing a specific FSMO role, such
as PDC Emulator. In the Connect to Domain Controller window (Fig. 7.5) you can
see your current DC's name and the list of available controllers.
The Active Directory Users and Computers snap-in has a few specific features,
which don't change the administrative options of the snap-in essentially, but
significantly affect the scope of objects available for manipulating. These features are
discussed below.
Saved Queries
An administrator can create one or more queries using the LDAP filters and save
them in the snap-in for subsequent use. These queries will allow him or her to quickly
select the necessary objects only, which simplifies work with large number of
directory objects of a specific type (user, group, computer, etc.). All queries are
stored in the Saved Queries folder in the snap-in's tree pane and can be organized
in a folder structure (see an example in Fig. 7.6).
You can either immediately create a new query on a computer or import query
definition of an already existing query.
To create a query:
4. Click Browse and select the query root — a container in the domain structure
(by default, the entire domain container will be looked through). Make sure that
the Include subdirectories box is properly set.
5. Click Define Query and compose a necessary query string. For detailed
information on that operation, see the "Filter Options" section.
6. Click OK. The query is ready.
The saved queries are not sorted and are placed in the query structure in the order
that they are created.
Saved queries are stored on the computer where they have been created. (These
queries are included in the roaming user profile if the user has such a profile.) To
distribute saved queries, the Help and Support Center proposes to copy the dsa.msc
file to other domain controllers (located in the same domain). However, this
statement most likely needs clarification.
In Windows .NET, some administrative snap-ins save the user settings in XML files
located in the “Documents and Settings\<UserName>\Application
Data\Microsoft\MMC folder. The name of such a file correlates with the snap-in's file
name (see details in the next chapter, section "File Names of Administrative Snap-
ins"). I have found in my own experience that you can safely copy the dsa file from
that folder to another computer (to a similar folder in the user profile). Remember,
however, that all snap-in's settings (including all saved queries) are copied with this
operation.
There is a legitimate and proven way to distribute saved queries. You can simply
export a query definition (in XML format) and import it to every computer where it is
necessary. Right click a query name and select Export Query Definition. Save the
definition to a file, copy the file to another computer, start the Active Directory Users
and Computers snap-in, right click the Saved Queries folder, and select Import
Query Definition.
Advanced Features Mode
By default, the Active Directory Users and Computers snap-in only displays five
nodes in basic mode. For some administrative tasks this is not enough, and you need
to switch to the Advanced Features mode that displays some important "invisible"
containers and has additional options. This can be done using the Advanced
Features command in the View menu.
Perhaps one of the most valuable nodes shown in advanced mode is the System
container (Fig. 7.8), which provides access to a number of system objects, for
instance, to the MicrosoftDNS container that stores DNS zone information if a zone
(zones) is (are) Active Directory-integrated and is replicated on all DCs in the current
domain. (This is the only option in Windows 2000-based domains and one of four
possible options in Windows .NET-based domains.)
Even more important is that only in the Advanced Features mode will you have the
Object and Security tabs in the Properties window of any Active Directory object.
All changes related to delegation of control over some object are displayed in the
Security tab. For example, if you want to revoke an administrative right from a user
or a group, you need to open this tab for the object and delete the appropriate
permissions.
There is also one remarkable possibility related to this mode. You might notice that
five "default" nodes (plus the possible subdomains) are visible while browsing the
Directory node in the My Network Places folder from Windows 2000-based domain
clients (see Fig. 7.9 where a root and a child domains are shown). Sometimes this
information will annoy end users, while at other times you may not want end users to
be able to access these nodes.
Fig. 7.9: Browsing the entire domain tree may be tiresome or undesirable
You can control the "visibility" of any Active Directory container or object by using an
optional Boolean attribute showInAdvancedViewOnly (it can be set to FALSE or
TRUE, the case of the letters doesn't matter). The majority of Active Directory objects
have this attribute, and you can change its value as needed with the ADSI Edit tool
(see the "ADSI Edit Snap-in" section in this chapter). If an object (container) has this
attribute set to TRUE, the object will not be displayed during domain browsing or in
the base mode in the Active Directory Users and Computers snap-in. This has no
affect on the general behavior of the domain.
Fig. 7.10 shows the same domain structure that is represented in Fig. 7.9, but the
ShowInAdvancedViewOnly attribute has been set to TRUE for some domain objects,
so none of the users in the forest will be able to see the contents of these domains.
(In an actual situation, this might be too strict a limit, but do not forget that this is only
an example!)
Fig. 7.10: You can restrict browsing of both parent and child domains for clients and
"hide" unnecessary objects from viewing
Important Windows 2000-based client computers can browse any Active Directory
domains (Windows 2000- and Windows .NET-based). This feature has
not been included in Windows XP/.NET, and the Directory node is not
present in the My Network Places folder.
Note It is also possible to control the "visibility" of Active Directory objects using
access permissions. Both methods have their own pros and cons; therefore,
select the most convenient method, depending on your requirements. For
example, permissions allow for more comprehensive control, but if you use
them, rather than have the ability to make selected object invisible (or visible),
you will have to accept that all objects will become invisible (or visible) with your
selection.
Some Active Directory objects act as containers for other objects. By default, this fact
has no visible representation in the Active Directory Users and Computers snap-
in. Nevertheless, there are situations when you may wish to see all object relations.
For example, compare the two screenshots shown in Fig. 7.11 and Fig. 7.12. The
first one is a default view of the Domain Controllers OU and the NETDC1 domain
controller; the second one shows the same controller as a container.
Fig. 7.11: The default view of a domain controller
Fig. 7.12: Using the Users, Groups, and Computers as containers mode for locating a
published printer connected to the selected domain controller
As you can see in Fig. 7.12, the domain controller has child objects; in particular, a
published printer. You might want to move the printer object to any other OU. This
will not affect the printer's behavior.
Note All printers are initially published in Active Directory as child objects of relative
computers. You may want to gather them in a single OU for users' or
administrators' convenience, although the Search option is a more convenient
way to work with printers.
Filter Options
View menu or click the Set Filtering Options button on the Standard toolbar.
You can set the types of objects to be displayed from a predefined list, or create your
own custom filter. The process of creating a filter is intuitively simple. Fig. 7.13 shows
how to create a filter for selecting user accounts with names starting with the letter
"a". To activate the filter, you must click the Add button and place the criteria onto the
list.
In addition, you can use LDAP queries. Click the Advanced tab in the Find Custom
Search window and enter a query (LDAP filter string) in text format. For example, the
following query fetches only non-default user accounts:
Another option that helps to process large numbers of Active Directory objects is the
Find feature. In a sense, it works as a filter, but has a wider scope: you can find
objects in the entire directory (forest), in any domain, or in a selected container. To
find an object, you can use the Find command in each container's context menu or
select a container and click the Find objects in Active Directory button on the
toolbar.
Search (and advanced search) fields can vary, depending on the type of directory
objects (users, computers, printers, etc.). Search criteria for advanced operations are
composed in the same way as filters and have the same constraints. The Custom
Search option is the most flexible; it allows you to specify practically any attribute of
any directory object. The Windows .NET version of the Active Directory Users and
Computers snap-in provides also the Common Queries option that finds the user,
computer, and group objects only. For example, using this option, you can find
disabled user and computer accounts, or user accounts that have not been used
during a specified number of days.
Note When you find users in the Find Users, Contacts, and Groups window, the
string entered in the Name field is verified for matches with all user-naming
attributes — cn, First name, Last name, and Display name.
Note The In list comprises the names of containers (OUs) you've already visited.
In the window of the objects found, you can select all context menu commands that
are available for these objects in the usual snap-in window.
An example of the Find window and a sample result is shown in Fig. 7.14. This
search query finds all groups in the entire directory with names starting with the letter
"s". The example shown might not be particularly useful, but note that you can search
the whole domain forest (two domains in this case) as well as a selected domain or
container. In addition, it demonstrates that such a group as Server Operators is
present in either domain, but only one (root) domain has the Schema Admins group.
The display mode shown in Fig. 7.14 is not the default. To see the distinguished
names (i.e., all RDNs of the parent objects) of found objects, click Choose Columns
in the View menu, select the X500 Distinguished Name item and add it to Columns
shown.
To further filter the result of a find operation, click Filter in the View menu. The filter
bar will appear at the top of the result pane in the Find window. How to filter out
some groups and users among a number of similar objects is shown in Fig. 7.15.
Fig. 7.15: Filtering the search results: among all administrators, we have selected
those that belong to the ADMINs OU
Note In the Find window, it is possible to turn on the filter option for clients (by
default, the filter is set to off) by using the Enable filter in Find dialog box policy
in the user's administrative templates (sub-node Desktop | Active Directory).
One of the most troublesome disadvantages of the Active Directory Users and
Computers snap-in in Windows 2000 is its inability to manipulate a number of
directory objects, primarily, and user objects. Windows .NET offers a pleasant
improvement in that area.
For the most of directory objects (e.g., computers, groups, OUs, and etc.), you can
change the description only. However, in user objects, over 30 attributes can be
changed simultaneously. You select the objects as usual — using the <Shift> and
<Ctrl> keys. Then, you select the Properties command on the context or Action
menu. The set of allowed commands will be determined by the type of the objects
selected. When two or more objects are selected, the modified Properties window
opens. An example of that window for user objects is shown in Fig. 7.16.
Fig. 7.16: Appointing a profile and logon script to a number of users
On the Profile tab, it is possible to set all the same properties that are available in the
usual user's properties window. If you set a box, you define the value entered in the
appropriate field. If the field is empty, the existing attribute value will be cleared. If a
box is not checked (the appropriate field is grey), the existing value will be retained
without changes.
The Active Directory Sites and Services snap-in is the main GUI tool that allows an
administrator to configure Active Directory as a distributed network service. (Other
administrative tools consider Active Directory as a whole, at a logical level.) You
might almost forget about this snap-in in a small, single-site network with just a few
domain controllers. However, in large networks with many sites, this snap-in
becomes one of the essential administrative tools.
The Active Directory Sites and Services snap-in allows you to perform the
following operations:
In Fig. 7.17, you can see the main window of the Active Directory Sites and
Services snap-in, which displays practically all major elements of network
configuration: sites, subnets, inter-site links, connections, and servers (domain
controllers). Use and configuration of these elements is discussed in other chapters
of the book, since it is more advantageous to describe these questions in the context
of specific administrative tasks rather than in isolation.
Domain controllers running Windows .NET can store universal group membership
information locally, and refresh it periodically (by default, every 8 hours). This
diminishes the necessity to have a Global Catalog server in branch office locations;
as well, it reduces network traffic that occurs when users are authenticated in a
forest.
Using the Active Directory Domains and Trusts snap-in, you can raise the domain
as well as the forest functional level. In Windows 2000, a similar operation is called
changing mode (mixed mode or native mode). Right click a domain in the domain
tree and select the Raise Domain Functional Level command on the context menu
(see Fig. 7.19). You will see a window (Fig. 7.20) that informs you about the current
domain level and possible levels (if available).
If the domain consists of Windows .NET-based domain controllers only, you can raise
the domain level to Windows .NET (version 2002) right away. Select a level and click
Raise. If there are domain controllers on other platforms (Windows NT 4.0 or
Windows 2000), then the operation will fail. The system will report the controllers that
prevent raising the functional level. Such a report will contain lines similar to the
following:
The following domains include domain controllers that are running earlier
versions of windows:
To raise the forest level, point to the root in the tree pane (Fig. 7.21) and select the
Raise Forest Functional Level command on the context menu. Again, all errors that
have occurred will be reported.
If two domain forests have the Windows .NET (version 2002) functional level, then
the Active Directory Domains and Trusts snap-in will allow you to establish forest
trusts between root domains of those forests.
The concept of user principal names can considerably simplify the logon process in
large domain trees. While logging on, the domain users can use one of two methods
for specifying their names. They can:
Enter a UPN name, such as user@DNSdomainName (in this case, the domain list
becomes unavailable).
Enter a pre-Windows 2000 (SAM account) user name (without the "@"
symbol) and then select a domain from the list.
Each method has certain advantages. It may be inconvenient to enter long domain
names, such as dom1.comp1.ent1.com. The first method is, in fact, just a particular
instance of a general format: userName@UPNSuffix. The default UPN suffix is the
DNS name of that domain where a user account is located. It is possible to add
alternative suffixes that can be used by all users of a domain forest.
To add a UPN suffix, open the Active Directory Domain and Trusts snap-in, point
to the root in the tree pane, and select Properties from the context menu. Enter a
suffix in the Alternative UPN suffixes field and click Add and Apply. The entered
suffix (net in Fig. 7.22) will appear in the dialog box during new user creation.
Fig. 7.22: Adding an alternative UPN suffix
Now you can choose any UPN suffix for a new user (the current domain, parent
domain and alternative UPN suffixes) or change the UPN name for an existing user.
Let us create, for example, a user with the logon parameters shown in Fig. 7.23.
Initially, the logon name and the pre-Windows 2000 name are the same, but you can
specify any name you like.
The created user will be able to log onto the domain tree with the following names
(the password will be the same for both logon names):
EntAdmin@net — UPN name
EAdmin (and a domain name selected from the list) — SAM account name
You can also check these names using the ADSI Edit snap-in (sAMAccountName is
a mandatory attribute, and userPrincipalName is an optional attribute).
Note Notice that, by default, the "built-in" Administrator and Guest accounts do not
have UPN names.
Attention UPN names are not supported by Windows 9x/ME clients.
Verifying Trusts
A domain administrator can use the Active Directory Domains and Trusts snap-in
for verifying trusts between domains and for creating new trusts. This process
primarily concerns trusts with Windows NT 4.0 domains. Such trusts must be
manually created (see Chapter 5, "Installing Active Directory").
However, you may also want to create explicit, unidirectional trusts between AD-
based domains that belong to different domain trees (or forests — if the forest trusts
are established) or even to the same tree. This, for instance, may be required in
order to reduce logon time into a "remote" domain. Here, "remote" is related to the
"distance" between domains in a tree structure. (All considerations stated are even
applicable to transitive Kerberos trusts.)
You can also use the NetDom tool for verifying and resetting trusts.
The ADSI Edit snap-in, which is included in the Support Tools pack, is a tool that
provides "low-level" access to Active Directory. It allows you to perform the following
operations:
Connecting to Namespaces
The newly installed ADSI Edit snap-in is configured for work with three Active
Directory namespaces (contexts, or partitions):
The first namespace is replicated among all DCs that belong to the same domain.
The other two are replicated over every DC in the domain tree.
The ADSI Edit snap-in allows you to connect to any application directory partitions.
There are two default (built-in) application partitions that can be created on a DC and
used by the DNS server installed on the same DC (see Chapter 3, "Domain Name
System (DNS) as Main Naming Service"):
There is one more object, which the ADSI Edit snap-in can be connected to:
RootDSE
Note Note that the Windows 2000 version of ADSI Edit only shows the informational
(LDAP) attributes of the RootDSE object. Operational (system specific)
attributes, such as isSynchronized or isGlobalCatalogReady are not accessible.
The Windows .NET version of the tools displays all RootDSE's attributes.
You can also add the standalone ADSI Edit snap-in to any MMC console opened in
the author mode. In this case, it is added without any connection. If you create your
own MMC console, you have a feature such as the Favorites tab, which can be very
helpful for working with multilevel tree structures and various Active Directory objects
(which all have very long LDAP names).
To make a new connection, point the root node in the tree pane and select the
Connect to command from the context menu. Enter any string you want in the Name
field and specify the distinguished name of an object, or select a predefined name-
space from the Naming Context list (Fig. 7.25). You may also enter a domain or
server name different from the default one.
You can also create a connection to any object while browsing through the object
tree. Point to an object and select New Connection from here in the context menu.
All new connections are saved upon exit from the snap-in.
In the Advanced window (click Advanced in the Connection window) you can
specify alternative credentials, a port number, or choose the protocol: LDAP or
Global Catalog. To view or modify the current properties of a connection, select the
Settings command from the context menu for this connection. Any connection may
be deleted with the Remove command.
Editing Attributes of Active Directory Objects
Let us see how to work with the ADSI Edit snap-in in the two following examples that
contain some tips which may be useful for an administrator.
Suppose we would like to hide the Builtin container from browsing. Point to it in the
tree pane of the ADSI Edit snap-in and click Properties on the toolbar. In the
opened window, the Attributes pane (in Windows 2000 — the Select a property to
view drop-down list) contains all attributes of the selected object. You can quickly
locate an attribute in the list by typing in the first few characters of the attribute's
name (Fig. 7.26).
When the attribute has been selected, select True in the Boolean Attribute Editor
window and click OK, then Apply. (In Windows 2000, enter the new value TRUE, or
true — it does not matter — into the Edit Attribute field and click Set, then Apply.)
To delete the value of an attribute, click either Clear or Non set. If the attribute is
multi-valued, select a value, and click Remove.
This example shows how to modify the schema by using ADSI Edit.
By default, you cannot create a new object of the Container type using the Active
Directory Users and Computers snap-in. Sometimes it may be useful to have such
an option for organizing directory objects. (You might also wish to enable the creation
of any other object types.) To create this option, it is necessary to modify the schema.
1. If you have not yet connected to the schema name context, do so now.
2. Open the schema folder and find the container class (CN=Container).
3. In the Properties window, select the optional defaultHidingValue attribute (the
default value is TRUE).
4. Set value to False, then click Apply and OK.
5. Point to the Schema node and select Update Schema Now from the context
menu.
If the schema cache has been updated successfully, open the Active Directory
Users and Computers snap-in (restart it, if it has been already opened) and check
that the container object has appeared in the Action | New menu.
A query in the ADSI Edit snap-in is a custom template for displaying only desired
objects in the tree pane. (This is an analog to saved queries in the Active Directory
Users and Computers snap-in.) This makes working with large numbers of objects
or objects related to different Active Directory containers simpler. The queries can be
created in any Active Directory namespace (partitions), but remember that since a
namespace belongs to a specific domain, the queries work within the borders of one
domain only.
Let us create a query for all published folders. Point to the node related to the domain
context and select the New | Query command in the context menu. Give the new
query any name you like (Fig. 7.27) and click Browse to define a container — the
root of the search. In our case, it will be the root domain (net.dom).
Fig. 7.27: This window contains the parameters necessary for creating a custom
query
The next step is to define the query itself. You can either directly enter a query in the
Query String field or click Edit Query and start the wizard that helps to create a
custom filter (see the "Filter Options" section, Fig. 7.13). The generated string is
displayed in the Query String field. (Remember the limitations of custom filters!)
To see all folders, you must specify the Is present option (the "*" character) for the
folder name. Select the appropriate query scope — Subtree Search or One Level
Search.
An example of the resulting display is shown in Fig. 7.28. Notice (in the
Distinguished Name column) that the selected folders are related to different OUs in
the same domain. This means that you have really searched the entire domain.
Fig. 7.28: The query that allows you to work with all published folders in the whole
domain forest
All queries are saved upon snap-in closing, and refreshed upon its loading. You can
refresh the contents of a query at any time. To edit a query, select Setting from the
query's context menu.
Creating Active Directory Objects
Using the ADSI Edit snap-in, you can create Active Directory objects of any type.
However, it can hardly be recommended that you do so, because of a high probability
of errors with object attributes: you must be familiar with the meaning of all
mandatory and optional attributes and their valid values. Using the "standard"
administrative snap-ins and tools is much more preferable.
If, nevertheless, you do decide to create an object manually, point to the desired
object in the tree pane and select the New | Object command. The wizard will start
and ask you for all required values. The list of possible new objects depends on the
type of object selected initially. (See also "Extending the Schema" in Chapter 16,
"Active Directory Service Interfaces (ADSI).")
Being able to work directly with a global catalog (GC) server may be helpful while
troubleshooting the problems related to GC replication. You can connect to different
GC servers and compare the values of stored attributes (see also the description of
DsaStat.exe in Chapter 11, "Verifying Network and Distributed Services"). You can
also verify the representation of attributes in a GC. (This process can be controlled
via the Active Directory Schema Manager snap-in, see the next section.)
Note Only some of Active Directory object's attributes are presented in Global
Catalog. When you have enabled/disabled replication of an attribute to Global
Catalog, you may wish to use the ADSI Edit snap-in to verify the presence of
this attribute on a GC server.
In general, the procedures for working with Global Catalog are the same as
described above. The only difference is that you must select the Global Catalog
protocol in the Advanced window when creating a connection to an Active Directory
naming context (partition). It must be clear that it is impossible to create new objects
in Global Catalog.
The Active Directory Schema Manager snap-in is the preferred GUI tool (the other
one is the ADSI Edit snap-in; its usage requires that you have a more advanced
familiarity with Active Directory's interiors) that allows viewing and modifying of Active
Directory classes and the attributes the classes contain. (Two other ways to extend
the schema are scripting and using command-line tools, such as LDIFDE and
CSVDE.) This snap-in allows an administrator to view X.500 OIDs of classes and
attributes, a range of values for attributes, mandatory and optional attributes for
classes, and other meta-information on attributes and classes.
Installation
regsvr32 schmmgmt.dll
Fig. 7.29: This message will appear if the DLL-file is registered successfully
All modifications of the schema are only permitted on the DC that possesses the
Schema Master FSMO role. It is highly recommended that you adhere to this
requirement.
Note To find the Schema Master in a forest, use the following command: dsquery
server — hasfsmo schema.
Attention By default, only members of the Schema Admins group can modify the
schema. It is, however, also possible to grant this permission to other
people.
The schema's updates are dumped from cache to disk every 5 minutes.
You can manually reload the schema to force this process.
Modification and, in particular, extension of the schema, require a profound
understanding of Active Directory concepts and classes structure, and this could be
the theme of a separate book. (Some basic information on this question is given in
Chapter 16, "Active Directory Service Interfaces (ADSI).") However, in routine work
an administrator may want to perform the following operations (these are the names
of checkboxes at the General tab in the Properties window of an attribute or a class;
see Fig. 7.31):
Attribute (class) is active (in Windows 2000, a similar flag Deactivate this
attribute (class) has an opposite meaning). If a newly created (e.g., a test)
attribute or class is not yet used (i.e., there are no new objects of that class, or
that attribute has not been added to a class) in Active Directory, you may
"disable" it. (You cannot delete attributes and classes in Active Directory.)
Such an attribute or class is considered to be defunct. In Windows .NET, it is
possible to redefine and reactivate it.
Index this attribute in the Active Directory. Indexing of an attribute speeds
up the frequently used query operations that include the attribute.
Replicate this attribute to the Global Catalog. If an attribute is included in
Global Catalog, you can get the attribute's values when performing forest-wide
queries.
Show objects of this class while browsing. This flag controls the state of
the showInAdvancedViewOnly attribute (see above "Hiding Directory Objects
from Browsing"). If this flag is set, the attribute's value is FALSE. The flag
possibly affects the custom (newly created) classes only.
To carry out these operations, expand the Attributes or Classes node in the tree
pane and find the desired attribute or class. Open the Properties window and set the
appropriate flag on the General tab.
Caution After a new attribute has been added to the global catalog, a forest-wide
replication is triggered. (This is the case regarding all schema modification
operations.) This can result in significant network traffic. Therefore, this
operation should not be performed often and should be well planned.
Let us discuss how to create a new attribute and class on a few examples. (See also
about extending the schema in Chapter 16, "Active Directory Service Interfaces
(ADSI)" and Chapter 17, "Scripting Administrative Tasks.")
Creating an Attribute
Before creating an attribute, you must carry out the following operations:
Attention The base X.500 OIDs — one for classes and one for attributes — are
obtained only once for your organization. Then you can add your own
increasing IDs to the base OIDs.
When you have gathered all this information, point to the Attributes node in the tree
pane and click Create Attribute in the context menu. Click Continue in the warning
window. Fill in the fields in the Create New Attribute window. (All fields except
Minimum and Maximum are mandatory.) Click OK. Fig. 7.30 displays sample
information necessary for the creation of a string attribute.
Fig. 7.30: An example of creating a new string attribute
Attention In Windows 2000, if you receive the "Schema update failed in
recalculating validation cache" error, verify the selected OID. Windows
.NET provides more specific diagnostic messages.
Now you can find the new attribute on the list, view the attribute's
properties (Fig. 7.31), give a description to it, and set the necessary flags
(checkboxes). At this point, you can use the created attribute, i.e., add it
to an existing class(es) (see below and in Chapter 17, "Scripting
Administrative Tasks").
Creating a Class
Point to the Classes node in the tree pane and click Create Class in the context
menu. Click Continue in the warning window. Fill in the fields in the Create New
Schema Class window. Fig. 7.32 illustrates this step. Click Next.
Fig. 7.32: The first step in creating a new object class
In the next window (Fig. 7.33), you can add mandatory and optional attributes to the
class. If you leave both lists empty, the new class will have only the attributes of the
parent class. You can add and remove attributes until you click Finish.
Fig. 7.33: In this window, you can add mandatory and optional attributes
Attention It is possible to add optional attributes to a class at any time, but the
mandatory attributes are added only at the class's creation.
To define a possible superior for the new class, select the class from the list, open
the Properties window, and click the Relationship tab (Fig. 7.34). Add the
necessary class, click Apply, and close the window. You have now created a new
class.
Fig. 7.34: This window allows you to add auxiliary classes to a class and to define
containers (possible superiors), in which objects of that class can be created
If the class created is of the auxiliary type, you may wish to add it to an existing class.
To do this, select a class, open the Properties window, click the Relationship tab,
and add the new class to the Auxiliary Classes list (Fig. 7.34).
You can add necessary attributes to the Optional tab on the Attributes tab: click
Add and choose an attribute from the Select Schema Object list. Click Apply and
close the window. Reload the schema or wait until the schema's updates are written
to disk. Then the new attributes of the class will be "visible" in other administrative
tools.
The main purpose of the Group Policy Object Editor[1] snap-in is the editing of a
group policy object (GPO) stored locally on a computer or in Active Directory, and
linked (in the second case) to an Active Directory container: a site, a domain, or an
OU.
In Windows 2000, you should have a solid understanding of the difference between
the Group Policy Object Editor snap-in and the Security Policy — Local, Domain
Controller, or Domain — snap-ins. (These last three snap-ins are configured by
default on every DC; the Local Security Policy snap-in is also configured on every
client Windows 2000 system.)
The Group Policy Object Editor snap-in works with an entire GPO, and can be run
from certain administrative snap-ins or from a custom MMC console. It contains both
computer and user policies (the Computer Configuration and User Configuration
nodes of GPO).
The Security Policy snap-ins deal only with the Security Setting sub-node of the
corresponding GPO, and can be run from the Start menu (the Administrative Tools
submenu). These snap-ins allow you to configure computer policies only.
In Windows .NET, the Security Policy snap-ins are always configured to work with
entire GPOs.
Note Do not forget about two other important snap-ins — Security Configuration
and Analysis and Security Templates — that also help an administrator to
deploy Active Directory security in an enterprise. Due to space limitations and
other reasons, these snap-ins are not discussed in this book.
Note See Chapter 8, "Common Administrative Tasks," about refreshing your
computer (machine) and/or user policies after editing a GPO's parameters.
A running Group Policy Object Editor snap-in is always linked to a GPO. Therefore,
you need to learn two things: how to start the snap-in itself, and how to link it to a
GPO.
There are three ways to start the Group Policy Object Editor snap-in:
From the Active Directory Users and Computers snap-in — select the
domain or an OU, open the Properties window, and click the Group Policy
tab (Fig. 7.35).
Fig. 7.35: A sample list of GPOs linked to a domain container
From the Active Directory Sites and Services snap-in — select a site, open
the Properties window, and click the Group Policy tab.
From Microsoft Management Console (MMC) — start MMC (enter mmc in the
Run window) or open a custom console, and add the Group Policy Object
Editor snap-in. The Select Group Policy Object window allows you to link to
the local GPO (default option) on the local computer (it is also possible to
select another computer). An alternative option is to open the Browse for a
Group Policy Object window (by clicking Browse) (see Fig. 7.36).
Fig. 7.36: In this window, you can see the entire structure of OUs in a domain
as well as the GPOs linked to them
In two first cases, you have three options:
Select an existing GPO (i.e., already linked) in the list and edit it by using the
Group Policy Object Editor snap-in
Create a new GPO that will be linked to the selected container
Add (link) an existing GPO to the container
Let us discuss the last case (use of MMC). If you click Add on the Group Policy tab,
the Browse for a Group Policy Object window will open. An example of the default
view of such a window is shown in Fig. 7.36. (You may click the circled icon and
create a new GPO.)
As shown in Fig. 7.37, all GPOs that exist in a domain are listed in the All tab, so you
can quickly find the necessary GPO.
Fig. 7.37: Use this tab to quickly find a GPO that you want to link to the current
container
Important When the Group Policy Object Editor snap-in is opened or a custom
MMC console is created, it is not possible to re-link the snap-in to another
GPO.
You cannot change the DC with which the Group Policy Object Editor
snap-in works (therefore, the default Security Policy snap-ins, too) (see
later "Selecting a Domain Controller", and it is not possible to connect to a
local GPO stored on another computer.
You can check which containers the selected GPO is currently linked to. In the
Group Policy Object Editor snap-in's window, point to the root node in the tree
pane and open the Properties window for the GPO. Click Links tab (Fig. 7.38).
Select an applicable domain and click Find Now. If the GPO is linked to other
containers, you will see their names on the list in addition to the name of the current
container.
Fig. 7.38: You can quickly verify whether the selected GPO is linked to other
containers besides the current one
Attention Due to possible security and administrative conflicts, it is not advisable to
link GPOs stored in a domain to containers from another domain.
To create a GPO, it is sufficient to click New on the Group Policy tab in a container's
Properties window (see Fig. 7.35), or to click the button in the Browse for a Group
Policy Object window (see Fig. 7.36). Name the new GPO, and you may then begin
editing it.
When you are going to delete a GPO, you have two options:
Remove the link from the list. When selecting this option, you break only the
link between the selected GPO and the current container. The GPO remains
intact, and you can use it later.
Remove the link and delete the Group Policy Object permanently. As the
message indicates, this is a more decisive option, since you not only break the
link, but entirely delete the GPO. (Remember that this GPO can be used by
other containers!)
WMI Filters
In Windows .NET-based domains, you are able to "link" a GPO to a specific property
of client computer. Let me explain this in the following example.
Suppose we want to assign some group policy setting (a GPO) to users (or
computers) that work on Windows 2000 Professional systems only, and that GPO will
in no way affect the other users (or computers). The following procedure will permit
us to carry out this task:
1. Create a new GPO. (You can select an existing GPO. However, it would be
better to use a new GPO and link it to a container only when all configuration
operations are completed.)
2. Configure al necessary policies.
3. Open the GPO's Properties window and click the WMI Filter tab (Fig. 7.39).
Fig. 7.39: This tab allows you to select a WMI filter and link it to the GPO
selected
From the Manage WMI Filters window you can manipulate (edit, export, etc.) all
WMI filters stored in the system. Many examples of WMI filters can be found in the
Help and Support Center.
Fig. 7.41: These options determine which DC the Group Policy Object Editor snap-
in selects at its startup
It is necessary to comment only the second option. You can start the Group Policy
Object Editor snap-in from either the Active Directory Users and Computers or
the Active Directory Sites and Services snap-in, which is targeted to a DC (any DC
in the forest) at that moment. If you select the second option, the Group Policy
Object Editor snap-in will obtain a group policy setting from a GPO stored on that
DC.
The selected option is saved and used when the snap-in runs the next time.
Note In Windows 2000, you cannot define the "preferred" DC for the Security Policy
snap-ins.
Attention If the selected DC is not accessible at the snap-in's startup, an error will
be reported. Verify the setting (and the policy if defined), and select
another option if necessary.
A window similar to shown in Fig. 7.41 will appear when you start the
Group Policy Object Editor snap-in from an administrative snap-in and
the PDC Emulator is not accessible at the moment. In that case, you can
select any option except the first one and obtain a GPO from another DC.
Because the DNS is used for locating GPOs, the errors at the Group
Policy Object Editor snap-in's startup are very often related to the
malfunctioning of DNS. Therefore, always verify the DNS configuration
when you encounter such errors. Remember that DNS is a dynamic
system, and the registered records periodically expire.
There is a group policy that allows an administrator to define the strategy of selecting
a "preferred" DC. Open the Default Domain Policy GPO (or other applicable GPO)
and select the User Configuration | Administrative Templates | System | Group
Policy node. Double click the Group Policy domain controller selection policy.
Click Enable and select one of the following options:
If this policy is disabled or not configured, the Group Policy Object Editor snap-in
will always select the PDC Operation Master (PDC Emulator) for the domain. When
defined, the policy overrides the option selected in the Group Policy Object Editor
snap-in.
Note How to run the Group Policy Object Editor snap-in from the command
prompt, see the "Running GPO Editor" section in the next chapter.
In Windows .NET, the user interface of the Group Policy Object Editor snap-in has
been enhanced. As you can see in Fig. 7.42, all nodes (primarily, the Administrative
Templates) comprise two tabs, — Extended and Standard. If you select a policy on
the Extended tab, you can view the policy of description and OS requirements. This
information is a good substitute for many pages of documentation and makes
learning the policy purpose and selection of a proper policy considerably simpler. In
Windows 2000, the policy description is only available on the Explain tab in the
policy's Properties window.
Fig. 7.42: The main window of new version of the Group Policy Object Editor snap
in
There are some common recommendations and tips for using and configuring GPOs.
Let us discuss them.
If your system was upgraded from Windows NT 4.0 and/or you use the older
ADS-files, pay attention to the value of the Show Policies Only flag in the
View menu for the Administrative Templates nodes. When set, this flag
prevents Windows NT 4.0-style system policy settings from applying to
Windows 2000/XP/.NET systems.
[1]
In Windows 2000, this snap-in is called Group Policy.
The tasks discussed below are carried out using administrative snap-ins or different
utilities from the Windows .NET Support Tools or the Windows 2000 Resource Kit.
Let us consider how to use this command with the administrative snap-ins.
Note If the RunAs command fails, make sure that the Secondary Logon service
(seclogon; in Windows 2000, it is called RunAs Service) is running on the
computer (run the Services snap-in and check the status of the service).
Select the tool in the Start | Programs | Administrative Tools menu (or Start
| All Programs | Administrative Tools).
Open the window that contains all the tools. Click Start | All Programs |
Administrative Tools, and select either Open or Open All Users in the
context menu. (The former command will open the window that only contains
the tools created by the user, while the latter opens the window that contains
all tools installed by default.) Select the tool in the open window.
Copy (drag and drop) icons of the necessary tools to the desktop. (You may
also create one or more folders on the desktop, and copy the icons to them.)
Then, for any administrative snap-in, you can open the context menu and select the
Run as command. (There are some limitations on computers running Windows
2000.) You will see a window similar to the one shown in Fig. 8.1.
Fig. 8.1: By entering proper credentials in this window, you can start a program on
behalf of another user
The upper (default) switch allows you to start the tool on behalf of your current
account (i.e., with your current privileges). The other option (shown) — The
following user — will allow you to enter an administrator's credentials, and start the
tool in the "privileged" mode. Both the domain and user names should be used in this
window (this covers Windows 2000 domains, too): you can specify either a full SAM
account (pre-Windows 2000) name (as shown on the screenshot) or, in Windows
.NET, a UPN name (e.g., JSmith@net).
Note The procedure described above can be used with any EXE- or MSC-file, and
not only with administrative tools. (See the next section.)
In addition, you can open any administrative tool's Properties window, click
Advanced on the Shortcut tab, and set the Run with different credentials flag. In
Windows 2000, you should check the Run as different user box on the Shortcut
tab. After this operation is performed, the system will always propose that you start
the tool as another user.
Note Notice also the Author command on the context menu of administrative tools.
This command allows you to start a snap-in in author mode and then to modify
it. By default, all tools are saved in User mode — full access, and the Do not
save changes in this console box is not checked. To prevent users from
changing the administrative snap-ins, you may use the user administrative
templates in the Group Policy Object Editor snap-in.
Using the RunAs command, it is possible to start any executable file — EXE, COM,
CMD, BAT, MSC; shortcuts to programs (LNK); and Control Panel items (CPL) — on
behalf of a different user. Let us discuss some examples. (You can get complete
information on RunAs in the Help and Support Center or by running runas /?)
Note RunAs cannot be used with some items, such as Windows Explorer, the
Printers folder, and desktop items.
Note Usually, it is much more convenient to start MMC tools with RunAs from the
command prompt rather than from the Run window, because in the first case,
you will be able to see possible errors. For frequently used commands, you
may want to create shortcuts on the desktop.
Suppose you are currently logged on to the net.dom domain with a "normal" user
account, and want to configure the domain controller security settings, which requires
administrative privileges (see Table 8.1). In the Run window or at the command
prompt enter the command:
Table 8.1: Some Administrative Tools and the Privileges Necessary to Use Them
Tool name Snap-in's name Necessary privileges
Administrator is the name of a user that is a member of the Domain Admins group.
Enter the administrator's password when prompted.
Now you want to create a user in the subdom.net.dom domain using the Active
Directory Users and Computers snap-in (i.e., you would like to work in a domain,
other then the domain where you are logged on). Enter the following string:
RunAs can be very helpful for setting up user permissions on a file or Active Directory
objects. To set the necessary permissions for a user, you may start a tool using
administrative privileges. At the same time, it is possible to open the command
prompt or start a program on behalf of this user and check the resulting permissions.
You need not either repeatedly log on to the system using different accounts or use
several computers.
File Names of Administrative Snap-ins
To use administrative tools with RunAs, you should know the names of the
corresponding snap-ins. Also, some tools can only be used with administrative
privileges. Table 8.1 contains information on some important tools.
By default (when started without any parameters), the Group Policy Object Editor
snap-in is focused on the local GPO stored on computer. Generally, you have two
options:
Run this snap-in with a preconfigured GPO. You can use either the standard
snap-ins (gpedit.msc, dompol.msc, and dcpol.msc) or custom MMC consoles
with the Group Policy Object Editor snap-in.
Specify a GPO when the snap-in runs.
In the first case, you can create a custom MMC console, add the Group Policy
Object Editor snap-in to it, link the snap-in to a necessary GPO (stored on a remote
computer or in Active Directory), and save the console with any name you like. Then
you can start the console by its name. This is the "static" approach.
By using the second method, you are exploiting the fact that the Group Policy
Object Editor snap-in (the gpedit.msc file) allows you to change its focus (the
"dynamic" approach). For example, the following command allows you to open a
GPO stored on a remote computer (even the local computer specified with the
/gpcomputer parameter is considered to be a "remote" one!):
C:\>gpedit.msc /gpcomputer:"netdcl.net.dom"
Attention You cannot view and manage the Security Settings extension (except
for the IP Security Policies) of a remote computer's GPO. The Software
Installation and Folder Redirection extensions are never displayed for
local GPOs.
You can also run gpedit.msc and specify the distinguished name of any GPO stored
in Active Directory. The following approach will help the user to do this most
effectively.
At the command prompt, carry out a search operation by using the Search.vbs script
(Ldp.exe and DsQuery.exe can also be used) with parameters similar to:
On the screen, you will see the list of all GPOs stored in the domain, for instance:
The DsQuery command shown below will produce the same result:
You can easily select a necessary policy by its friendly name and use its DN as the
parameter. (Don't forget about the copy-and-paste feature of the command prompt
window.) For example, to open the Default Domain Policy shown above, use the
following command (the quotes are mandatory):
C:\>gpedit.msc /gpobject:"LDAP://
CN= {31B2F340-016D-11D2-945F-00C04FB984F9},
CN=Policies, CN=System, DC=net, DC=dom"
This command used with the RunAs will have the following syntax:
C:\>runas /user:net\administrator "mmc gpedit.msc
/gpobject:\"LDAP://CN={31B2F340-016D-11D2-945F-00C04FB984F9},
CN=Policies, CN=System, DC=net, DC=dom\""
Remote Administration
To administer Active Directory from a domain client computer, you have the following
standard options (the order is not important):
Table 9.2: Snap-ins Included in the Windows .NET Administration Tools Pack
Active Directory Domains and Trusts Internet Information Services
Active Directory Schema Manager Network Load Balancing Manager
Active Directory Sites and Services Remote Desktops
Active Directory Users and Computers Remote Storage
Certification Authority Routing and Remote Access
Cluster Administrator Server Extensions Administrator
Connection Manger Administration Kit Telephony
DHCP Terminal Services Licensing
Distributed File System Terminal Services Manager
DNS WINS
Caution The Windows .NET Administration Tools Pack cannot be installed on
computers running Windows 2000! In general, Windows 2000
Administration Tools could be used for administering Windows .NET-
based domains; however, some limitations exist in that case. A better
choice would be to install the Windows .NET Administration Tools
Pack and use it for managing domain controllers running both
Windows 2000 and Windows .NET systems.
For some reason, you might want to install only one or just a few separate
administrative tools on a client computer instead of the entire Administration Tools
pack. This can be done quite easily. (But don't forget about security requirements!)
You will have to carry out the following steps:
1. Copy the necessary snap-ins (files with MSC extension) from the
%SystemRoot%\system32 folder on a DC to any local folder you wish.
2. Copy the appropriate DLL(s) to the local %SystemRoot%\system32 folder or
to any local folder.
3. If the DLL has been copied to a folder other than %SystemRoot%\system32,
you must first change the folder as necessary. To register the DLL, enter the
following string at the command prompt:
4. regsvr32 <DLLname>
5. For example, to register the DLL for the Active Directory Users and
Computers snap-in, enter regsvr32 dsadmin.dll.
Now you may create shortcuts for new snap-ins, and then run them. Of course, you
have to be logged on to the domain with appropriate (administrative) privileges.
The following table contains DLL names for some administrative snap-ins.
Notice that both the Active Directory Users and Computers and Active Directory
Sites and Services snap-ins use the same dsadmin.dll file. Both snap-ins actually
provide similar operations (browsing and editing properties) with directory objects.
The former enables you to work with the entire domain naming partition of Active
Directory. The latter provides access to two containers in the Configuration partition,
namely, Sites and Services (you can also view them with the ADSI Edit snap-in).
Built-in search features (see the next section) — the most convenient way for
a user to find a shared folder or printer, user, group, or other common
directory object. All other tools are intended for administrators.
DsQuery.exe and Dsget.exe — the standard Windows .NET command-line
search utilities (see Chapter 12, "Manipulating Active Directory Objects").
The ADSI Edit snap-in (from the Support Tools) — using this tool, an
administrator can create powerful queries and modify objects in all directory
partitions (see Chapter 7, "Domain Manipulation Tools").
The Search.vbs script (from the Support Tools) — the simplest query tool that
uses the LDAP protocol. Can be used on any Windows platforms (see Chapter
12).
Active Directory Administration Tool (Ldp.exe from the Support Tools) and
Active Directory Browser (AdsVw.exe from ADSI SDK) — complicated
administrative tools that also allow an administrator to browse through the
directory tree and modify objects. Ldp.exe uses the LDAP protocol and is the
only tool that can retrieve deleted objects. AdsVw.exe uses both LDAP and
WinNT protocols, and works with AD-based (Windows 2000 and Windows
.NET) and Window NT domains (see Chapter 12).
The Guid2obj.exe utility (from the Windows 2000 Resource Kit) — a
specialized tool that can determine the distinguished name of an object from
its GUID.
Most of the listed tools require a good understanding of LDAP filter syntax. Only then
will you be able to quickly and precisely find or choose the necessary objects.
By default, users — those who are aware of this option — can search Active
Directory for various objects by using the Find command from the context menu of a
domain displayed in the Directory folder (in My Network Places). This option is
available on computers running Windows 2000 and has been removed from
Windows XP/.NET. (One can also use the Active Directory Users and Computer
snap-in installed on a client computer.) There are two specialized commands called
from the Start | Search menu: For printers and For People.
It is possible to provide users with powerful search features and add a shortcut for
these operations to the desktop or any folder. You need to perform the following
steps:
1. Right click the desktop and select New | Shortcut from the context menu.
2. Enter the following string (case sensitive!) in the Type the location of the
item field, and click Next:
3. rundll32.exe dsquery,OpenQueryWindow
4. In the next window, enter a name for the shortcut and click Finish.
5. You might also wish to move the created shortcut to some folder or menu.
After clicking the shortcut, the user will see the search window similar to the one
shown in Fig. 7.14. From that window, it is possible to find users, contacts, groups,
printers, OUs, etc.
Note This feature works fine on all Windows systems (from Windows 95 to Windows
NT 4.0) provided that the Active Directory Client Extension (DSClient.exe from
the Windows 2000 Server CD; see also links in Appendix A). (Windows
2000/XP/.NET systems have that client as a built-in feature.) Just keep in mind
that you must not enter a space between the dsquery and OpenQueryWindow
parameters.
There are, in fact, quite a number of tools that allow an administrator to create,
delete, and modify one or more Active Directory objects. You should be familiar with
all (or at least most) of them to be able to choose the most effective tool for a specific
task. Let us list all of the main facilities provided on Windows 2000 and Windows
.NET platforms:
Note Pay attention to the fact that the DsMod.exe utility can pipe in results
from DsQuery.exe, which significantly enhances the utility's flexibility and
effectiveness.
Specialized administrative GUI tools (see Chapter 7 and Chapter 12) used for
specific operations and for fine-tuning and troubleshooting Active Directory.
The Active Directory Schema snap-in creates attributes and classes.
The ADSI Edit snap-in, Ldp.exe and AdsVw.exe create objects of any
type (including objects which cannot be created by any other tools), but
are primarily useful for editing attributes.
Tools for import/export (see Chapter 12) — command-line utilities that could
(and should) serve as powerful tools for administering large-scale Active
Directory installation. LDIFDE can also be used for changing the attributes of a
number of similar objects. On computers running Windows .NET, utilities from
the Ds*.exe "family" might be a better choice in many cases.
LDIFDE
CSVDE
Utilities intended for specific tasks (see later in this chapter and the Remote
Administration Scripts in the Windows 2000 Server Resource Kit).
AddUsers.exe, CreateUsers.vbs, and others (e.g., NetDom.exe can be
used for creating machine accounts in domains)
ADSI scripts (see Chapter 16, "Active Directory Service Interfaces (ADSI)" and
Chapter 17, "Scripting Administrative Tasks") — the most flexible of the
options and, in fact, a quite simple way to manipulate Active Directory objects
(especially for periodic routine tasks and when a large number of objects are
to be processed).
The Active Directory Users and Computers snap-in is, maybe, the main tool that
an administrator will use daily to manage various domain resources. The procedure
of creating and deleting Active Directory objects is basically the same for all types of
objects. There are buttons on the Standard toolbar for some of the most used
objects:
You can select one, several, or all created objects and move them into any container
or OU in the current domain. As usual in Windows, use the <Shift> or <Ctrl> keys for
selecting multiple objects.
The Windows .NET version of the Active Directory Users and Computers snap-in
offers some improvements in the user interface: you can use drag-and-drop
operations, and modify properties of several objects selected (for more details, see
Chapter 7, "Domain Manipulation Tools").
It is possible to choose a user account as a template, and create users with the same
properties (group memberships, profile settings, etc.) To start this process, select a
"template" user and click Copy on its context menu.
There are a few utilities (besides the batch import tools LDIFDE and CSVDE and
custom scripts) that simplify the creation of a number of user accounts in a field or
test environments.
Windows .NET Utility — DsAdd
A brand-new Windows .NET utility, DsAdd.exe, can create single computer, contact,
group, OU, and user objects in AD-based domains. It uses the LDAP protocol only.
With DsAdd, you can create a local, global, or universal (if it is allowed) group and
add specified members to it at the same time (not later!). For example:
Here is an example of how to use DsAdd to create a user and add it to the specified
groups:
This script can only create users. It operates with both the WinNT and LDAP
providers. The created accounts will be enabled. The following attributes are required
(the minimal set of attributes):
Note You can specify many other attributes, too; however, not any attribute available
for an user object is permitted. Carefully test your command (and the input file,
if present). Be sure that all specified attributes are consistent; otherwise, you
could easily get an error message similar to:
This error (8245) means that "The server is unwilling to process the request".
One of the possible sources of this error is the incorrect "naming" attributes: cn,
name, sn, distinguishedName, etc. Do not forget to enclose any attributes'
values containing spaces in double quotes.
Working ...
Getting domain WinNT://NET ...
Creating user user01
Succeeded in creating user user01 in NET.
Maybe the most intriguing issue is how to create a number of users at once. It is
actually very easy. Create a file with the desired user properties and use the
appropriate provider (WinNT or LDAP). For example, the following command will
create users specified in a file in the Staff OU:
AddUsers.exe (RK)
One negative aspect of AddUsers.exe is that the tool doesn't "see" the Active
Directory structure.
Note Using AddUsers.exe, you can successfully add users to existing groups,
despite the "Group already exists" error message. The groups may be located
in any container in Active Directory, not only in the "default" Users container.
[User]
{samAccountName, name, password, description, homeDrive, homeDirectory, profilePath,
scriptPath}
Administrator,,,Built-in account for administering the
computer/domain,,,,
Guest,,,Built-in account for guest access to the computer/domain,,,,
JSmith,John Smith,,A test user,Z:,\\netdcl\UserData\JSmith,
\\netdcl\Profiles\JSmith,Users\Welcome.vbs...
[Global]
{samAccountName, description, member's account names...}
Domain Admins,Designated administrators of the domain,Administrator,
Domain Controllers,All domain controllers in the
domain,NETDC1$,NETDC4$,
Domain Users,All domain users,Administrator,HelpAssistant_67861b,
SUPPORT_388945a0, krbtgt,SUBDOM$,Bob,John,Pam,...
...
[Local]
{samAccountName, description, member's account names...}
Administrators,Administrators have complete and unrestricted
access to the computer/domain,NET\Administrator,NET\Enterprise
Admins,NET\Domain Admins,
DC1Loca1Group,NET\John,NET\Lee,NET\Jessica,NET\Globa1Gr1,NET\UniGr2,
NET\DC1LocGr1,
...
Notice in the last line that groups may contain other groups (the group names are
shown in bold) including local groups (at the native and Windows .NET (version
2002) functional levels of a domain).
Caution It is possible that this tool has problems displaying memberships in global
and universal (placed in the [Global] section) groups. Test this in your
environment before you do any real work!
As you can see, the dump file contains three sections: User, Global, and Local. The
same format can be used for creating new users and groups. The irrelevant trailing
commas, as well as unused sections, can be omitted in the input file. New groups
may either be empty or contain the names of their members.
The Active Directory Users and Computers snap-in has a feature for "bulk"
operations that permits you to add a number of selected users and contacts to a
group. Point to an account (or choose a few accounts) and select the Add to a
group command from the context or Action menu, or click the Add the selected
objects to a group you specify button on the toolbar. Then specify a group in
the Select Group window. In Windows .NET, you can also carry out drag-and-drop
operations.
If you initially select an OU, the system asks whether you want to add all users and
contacts from this container to the specified group. This feature is very helpful for
administering OUs (but in Windows .NET, it is lacking).
To populate groups, you can use the LDIFDE and CSVDE tools, as well as the
AddUsers.exe utility. LDIFDE is also able to delete members from groups.
On computers running Windows .NET, you can use the standard DsMod.exe utility
that performs all modifications of groups. For example, the following command adds
two new members to the Schema Admins group:
The -rmmbr parameter removes the specified members, and the ‘-chmbr parameter
replaces all group members.
Shared folders in Active Directory have a feature that helps users to search for
information according to its characteristics. Select a published folder from the Active
Directory Users and Computers snap-in's tree pane, open its Properties window,
and click Keywords. You can add words that are logically related to the folder's
contents to the list. Then, if a user begins a search for shared folders in the Find
window, he or she can specify keywords and find resources based on their contents
rather than their names.
Caution When publishing a folder, you must be cautious, because the system will not
verify the entered folder name, and, as a result, you may run into an error in
the future, but only when you open the folder or map to it.
If the RDN and NetBIOS names of a Windows 2000 domain are different,
you will get the error — "The system cannot find the file specified" — when
publishing a printer (see the Microsoft Knowledge Base article Q255496). To
resolve the problem, you must install the latest Windows 2000 Service Pack
(at least, SP 1).
You can configure the process of publishing and pruning printers in the domain by
using group policies (see the Computer Configuration | Administrative Templates
| Printers node in the Group Policy Object Editor snap-in).
Both in Windows 2000 and Windows .NET domain, it is possible to enable Location
Tracking, a feature that allows users to find printers accordingly to their physical
locations. (See a remark in the "Active Directory Sites and Services snap-in" section
of the previous chapter.)
Pubprn.vbs Script
You can execute the system Pubprn.vbs script without parameters and get the help
information. The following command, for example, publishes the HP6MP printer
connected to the WKS10 computer in the Staff OU of the net.dom domain:
The system verifies the printer name and the existence of the object that is specified
by the LDAP name. If the printer has been published successfully, you will see a
message displaying the LDAP name of the printer in Active Directory.
Search operations are the preferred way for locating shared network resources in
AD-based domains. A user can find the necessary printer or shared folder easily and
perform any operation available while browsing through the domain tree.
The scope of the search can vary from a specific container (OU) in a domain to the
entire forest. (The Entire Directory option is equivalent to searching Global Catalog.)
In addition, users can specify various search criteria such as printer speed,
resolution, and so on. Fig. 8.2 contains an example of how to find all printers in the
forest. As you can see in the Server Name column, the printers come from various
domains. A user can point to an applicable printer and select the necessary operation
from the context menu.
Users can carry out the following actions on the found shared folder: open, search
the folder, map a network drive, and others.
Because the location of the Flexible Single Master Operation (FSMO) roles' masters
is very important for the proper functioning of a multi-domain forest, an administrator
must know which domain controllers possess a specific role(s) at any moment of the
entire network's lifetime. Therefore, he or she must have the facilities to find the role
masters easily and to transfer a role from one DC to another. Moreover, it is
necessary to have a way to forcibly transfer a role from a defunct DC. This is referred
to as the "seizing of role" process.
To find the owners of FSMO roles (operation masters), an administrator can use the
"standard" administrative tools (see the previous chapter):
The Active Directory Users and Computers snap-in displays the RID, PDC,
and Infrastructure masters.
The Active Directory Domains and Trusts snap-in displays the Domain
Naming master.
The Active Directory Schema snap-in displays the Schema master.
This approach is, however, time-consuming, and it makes sense to use some
command-line tools or scripts. Some such tools are described below; for more
information, see Chapter 17, "Scripting Administrative Tasks" (the "How to Find an
FSMO Master?" section and Listing 17.20).
A brand-new command-line utility, DsQuery.exe, will help you to find a specific role
master, for example:
You can also specify other roles: pdc, infr, name, schema.
NetDom.exe (see Chapter 12, "Manipulating Active Directory Objects") can display all
operation masters known to a specified DC. Use the following command syntax:
This command file is, in fact, a chain of instructions to the NTDSutil tool. (These
instructions can also be entered manually.) The main command in that file is the
following:
The only mandatory parameter is the name of the DC from which the information is
retrieved. A sample screen output is shown below (the utility's prompt is in bold):
C:\>dumpfsmos.cmd netdc1
ntdsutil: roles
fsmo maintenance: Connections
server connections: Connect to server netdc1
Binding to netdcl ...
Connected to netdc1 using credentials of locally logged on user.
server connections: Quit
fsmo maintenance: select Operation Target
select operation target: List roles for connected server
Server "netdc1" knows about 5 roles
Schema - CN=NTDS Settings, CN=NETDC1, CN=Servers,
CN=NET-Site,CN=Sites,CN=Configuration,DC=net,DC=dom
Domain - CN=NTDS Settings,CN=NETDC1,CN=Servers,
CN=NET-Site,CN=Sites,CN=Configuration,DC=net,DC=dom
PDC - CN=NTDS Settings,CN=NETDC1,CN=Servers,
CN=NET-Site,CN=Sites,CN=Configuration,DC=net,DC=dom
RID - CN=NTDS Settings,CN=NETDC1,CN=Servers,
CN=NET-Site,CN=Sites,CN=Configuration,DC=net,DC=dom
Infrastructure - CN=NTDS Settings,CN=NETDC3,CN=Servers,
CN=NET-Site,CN=Sites,CN=Configuration,DC=net,DC=dom
select operation target: Quit
fsmo maintenance: Quit
ntdsutil: Quit
Disconnecting from netdc1...
All operation masters can be displayed with ReplMon.exe. Start the tool and add
servers to the Monitored Servers list (tree). (In this case, it is enough to add one
server only.) Select a DC from the tree pane, open the Properties window, and click
the FSMO Roles tab. Fig. 8.3 shows a sample view of this tab.
Fig. 8.3: Viewing all operation masters (the owners of FSMO roles) for a domain
From this window, you can test any operation master by clicking Query. ReplMon
answers with the following message: "Active Directory Replication Monitor was
able/unable to resolve, connect, and bind to the server hosting this FSMO role."
Note In addition, ReplMon can display all Global Catalog servers in the enterprise
(select the Show Global Catalog Servers in Enterprise command in a
monitored server's context menu).
Usually, to transfer an FSMO role from one DC to another, the administrative snap-
ins should be used. To seize a role, you must use the NTDSutil.exe.
Note For additional information on FSMO roles, you might be interested in Microsoft
Knowledge Base articles Q223787 and Q223346.
You might want, for some reason (e.g., before shut downing a DC for maintenance),
to transfer a FSMO role from the role's master to another DC in the domain. In the
Active Directory Users and Computers snap-in window, you must first connect to
the DC that is the potential (new) operation master, point to the root node in the tree
pane, and select the Operation Masters command on either the context or Action
menus. Click the appropriate tab: RID, PDC, or Infrastructure. You will see the
current owner of a FSMO role and the potential master name. Click the Change
button, and you will get a new operation master.
Be careful when transferring the Infrastructure role. If there are two or more DCs in
the domain, make sure that a message similar to the following one has not appeared
in the Directory Service log on the new operation master:
Date: 5/31/2002
Time: 6:07:14 PM
Computer: NETDC1
Description:
Domain controller:
If all domain controllers in this domain are global catalogs, then there
are no infrastructure update tasks to complete, and this message might
be ignored.
The Active Directory Domains and Trusts snap-in allows you to transfer the
Domain naming master FSMO role to any DC in the domain tree. This procedure is
simple: connect to the DC that will be the new role's owner, point to the root node in
the tree pane, and select the Operations Master command from the context menu.
Make sure that the names of the current master and future master are correct, click
Change, and confirm the operation. Remember that only one server in the forest
(enterprise) can perform the Domain naming master role, and in addition, that server
must be a Global Catalog server.
The Active Directory Schema snap-in allows transfer of the Schema Master FSMO
role to any DC in the forest. You should first connect to the potential master of the
role, point to the root node in the tree pane, and select the Operations Master
command from the context menu. After checking the DC name, click Change.
Remember that only one server in the forest can perform the Schema Master role.
Attention To modify the schema in Windows 2000, you must first enable this
operation (see Chapter 7, "Domain Manipulation Tools"). When you have
transferred the Schema Master role to a DC, the flag The Schema may
be modified on this Domain Controller remains set on the old schema
master. This might not be in accordance with your intentions, however.
Using NTDSutil
The NTDSutil can be used for transferring any FSMO role. This is the only tool that
allows an administrator to forcibly assign a role to a DC. (It is assumed that the old
owner of this role has been destroyed and cannot be repaired.) Using NTDSutil will
be discussed in detail in Chapter 10, "Diagnosing and Maintaining Domain
Controllers."
When an administrator has changed a GPO, he or she may want to refresh group
policy application to verify the effect of the new settings. (Certainly, it is possible to re
boot the computer or make the user re-register to the domain. However, this is not
always convenient.) On computers running Windows 2000, to perform this task, you
can use the SecEdit.exe command-line utility. Windows XP/.NET systems offer a
new utility (which you should use) — GPupdate.exe — for that purpose.
The command syntax is very simple. To refresh user policies, enter either of the
following commands (applicable to your system):
The GPupdate command without parameters updates both user and computer
policies.
If you want to re-apply policies (GPOs), even if they have not changed since the last
time they were applied, add the /enforce parameter to the SecEdit command or the
/Force parameter to the GPupdate command. (Normally, GPOs are applied only once;
unchanged GPOs are skipped.)
Note You may want to change the default GPO refresh interval (90 minutes for client
computers and 5 minutes for domain controllers), as well as the offset (30
minutes for client computers and 0 minutes for domain controllers). For that
purpose, use group policies (Computer Configuration | Administrative
Templates | System | Group Policy) or modify the system registry. For more
information, see Microsoft Knowledge Base article Q203607.
Triggering Replication
An administrator has three tools that can be used to trigger Active Directory
replication of either all directory partitions (contexts) or just a specified partition
between a domain controller and one or all of its direct replication partners:
The Active Directory Sites and Services snap-in
RepAdmin command line utility
ReplMon GUI utility
As is typical for practically any administrative task, you can also use scripts (see
example in Chapter 17, "Scripting Administrative Tasks").
Note Remember that the "source" server (DC) always replicates its changes to the
"target" server (DC). Usually, you first select the target, then the source.
All directory partitions configured for that partner are replicated. (You can see all their
names — including application directory partitions — in a connection's Properties
window.) You have no options to replicate one partition only.
With RepAdmin.exe, you replicate each directory partition separately and from one or
all sources. (This command-line tool has the same functional capabilities as
ReplMon, a GUI tool.) For example, to trigger replication for a destination server, you
can use the following command:
where netdc2.net.dom is the server DNS name, and DC=net, DC=dom is a partition name
(the domain naming partition in this case).
The difference between this command and the operation shown in Fig. 8.4 is the
following:
The command replicates only one partition, but from all partners.
In the snap-in window you replicate all partitions, but from one partner only.
To force replication in the entire domain (forest), you might write similar commands
for each DC and all directory partitions to a command file, which will serve to fulfill
total replication in the domain.
Caution The repadmin /syncall serverName command replicates only one directory
partition (the Configuration partition), and performing such a command is not
enough to fully replicate the server specified.
The Windows .NET version of RepAdmin provides a new flag /A for the /syncall
operations. The following command synchronizes all partitions stored on NETDC1
DC with all its replication partners:
The following command replicates one partition from one partner (specified by its
GUID):
Normally, RepAdmin waits for replication to be completed. You can add the /async
parameters to the command to start an operation and not wait for its completion.
Synchronize each directory partition with all replication partners (there are
three additional options available with this mode)
Synchronize this directory partition with all replication partners
Synchronize this directory partition with this replication partner
You never need wait for a replication operation to complete, and all operation results
are written to the log files.
You can write custom scripts that will initiate replication events in accordance with
your own strategy. See, for example, Listing 17.17 in Chapter 17, "Scripting
Administrative Tasks."
One of the most remarkable features that Active Directory realizes is the possibility of
delegating all or part of administrative power over an OU or a directory container to a
group or a user (in both Windows 2000 and Windows .NET domains). Delegation of
control is essentially the same thing as "wizard-aided" granting of permissions on
Active Directory objects to a user or group. You can manually assign the permissions
necessary for performing this administrative task to a user or group, but this process
is considerably simplified thanks to the Delegation of Control Wizard. Delegating
control is quite a simple operation, and problems are only possible when delegated
tasks are being revoked from the user or group.
An administrator can delegate control (i.e., use the Delegation of Control Wizard
rather than manually assign permissions) for the following Active Directory objects
(common administrative tasks are cited in parentheses):
In the Active Directory Sites and Services snap-in (typical permissions are
Full Control, Read/Write, Create/Delete All Child Objects, Read/Write All
Properties):
Sites container
Inter-Site Transport container
Subnets container
A site(s) (only Manage Group Policy links task)
Server container in site(s)
In the Active Directory Users and Computers snap-in (the list of available
permissions depends on the type of Active Directory container):
Entire domain (Join a computer to the domain; Manage Group Policy
links)
Organizational unit (Create, delete, and manage user account; Reset
passwords on user accounts; Read all user information; Create, delete,
and manage groups; Modify the membership of a group; and Manage
Group Policy links. In Windows .NET, there are a few additional tasks.)
Computers container
ForeignSecurityPrincipals container
System container
Users container
Attention Remember that the Authenticated Users group (i.e., any logged on user)
by default has permission to add 10 computers to a domain. This group
has permission to Read All Properties of a domain object; consequently,
the group can read the value of the ms-DS-MachineAccountQuota
attribute, which by default is equal to 10. (This value can be viewed or
modified by using the ADSI Edit snap-in.) Draw your own conclusions.
(You might want to change this situation.)
To start the process of delegating control, run the appropriate snap-in, point to an
Active Directory container, OU, or the domain itself in the tree pane, and select the
Delegate control command on the context or Action menu. Depending on the
container type, you can select a common task(s) or create a custom task. In the first
case, you use a pre-defined set of permissions, while in the second case, you select
objects and permissions yourself, which allows you to be more specific in delegating
the administrative rights.
Look at Fig. 8.5. The Delegation of Control Wizard has been executed twice. First,
the permission to join computers to the domain has been delegated to the Admins
group. (You can see that permission as inherited from the domain context
DC=net,DC=dom.) Second, the Admins group has received the permission to create,
delete, and manage user accounts in the Staff OU. That right is defined at the OU
level and not inherited. As a result, the Full Control, Create/Delete User Objects, and
Create Computer Objects permissions have been added to the access control lists
(ACL) of the domain container and the Staff OU. (In Fig. 8.5, you can see these
permissions in the Permission entries pane — the first three lines.) You could add
these permissions manually, but the wizard helps you to do this without error and
frees you from having to know about all the details of Active Directory object
inheritance and permissions.
Fig. 8.5: The result of using the Delegation of Control Wizard: the highlighted
permission allows the Admins group to join computers to the domain and manage
users in the Staff OU
If you want to revoke all administrative rights from the Admins group, you should
perform the following steps:
1. To revoke control power over the Staff OU, delete the first two lines in the
Permission entries pane.
In Windows .NET, you can click the Default button, and all permissions added
for the selected directory object will be deleted. Be careful, since: 1) other
users or groups might have administrative rights over the object, and you will
delete all additional permissions; and, 2) the inherited permissions will be
restored.
On the other hand, you might want to allow the Admins group to perform some
additional tasks (after the Delegation of Control Wizard has been executed once, or
in any moment). Click Edit on the Permissions tab (see Fig. 8.5). The Permission
Entry window will allow you to define permissions (or delegate/revoke administrative
control, which is the same thing) on the selected object with greater granularity then
the wizard allows. As you can see in Fig. 8.6, there are a number of operations
whose execution by the selected user or group it is possible to allow/forbid.
Fig. 8.6: "Fine tuning" of permissions on the selected directory object
In general, the procedure of enabling audit consists of two steps. To audit access to
Active Directory, you must:
After the policy has been set, you can immediately apply it with either the
secedit/refreshpolicy machine_policy or gpupdate /Target:Computer command.
For read operations, it is recommended that you audit failure events, because a large
number of successful event entries can quickly overflow the Security log.
The performance of domain controllers can also suffer. For write, create/delete, and
other similar operations (that are much less frequent than read operations), it is
possible to audit both success and failure events.
By default, special access (successful and failed events) to all objects in a domain is
audited for the Everyone group. All domain objects inherit this setting from the root
domain container (Fig. 8.8). Some containers have additional audit settings. All
settings include auditing for "critical" operations, such as Write, Delete, Modify, and
others. (Look up the entire list.)
Fig. 8.8: The default audit settings for the Users container
You can see all audit entries in an object's Properties window: open the Security
tab, click Advanced, and open the Auditing tab. Then click Edit to view or change
audit parameters. If you open the Auditing tab for a non-root directory object, you
will notice that all checked boxes are grayed out. This means that all parameters are
inherited from the parent object. They cannot be directly modified, so you may need
to address the parent or root object. If you check a free box, the system will create a
new auditing entry and add it to the list for the selected object only.
Caution Because successful events are registered by default, you might get a huge
number of entries in the Event Viewer when working with auditing turned on.
Therefore, you might want to change the default settings when performing
an audit for an extended period of time.
You can view all information on audit events in the Security log of the Event Viewer.
The source for these events is "Security", and the category is "Directory Service
Access".
The standard Backup utility (NTBackup.exe) allows you to back up and restore both
critical data and Active Directory. Operations with Active Directory can only be done
locally for each domain controller. A backup operation is performed while a DC is
online. To restore Active Directory on a DC, you must boot this DC into Directory
Service Restore Mode (press <F8> at the computer startup).
System State
Backing up Active Directory is a part of the process of saving the System State data
of a DC. You cannot back up (or restore) individual items of the System State. On a
member server or a workstation, the System State includes the following:
Boot Files
COM+ Class Registration Database
Registry
Active Directory (the ntds.dit, edb.chk, edb*.log, and resl.log and res2.log files)
SYSVOL (System Volume) (by default, the %SystemRoot%\SYSVOL\sysvol
folder)
If the Certificate Services are installed on a server or DC, there is one more item:
Certificate Server
Important From the foregoing, it is possible to draw two very important conclusions:
Modifications of the schema are irreversible, so you cannot restore an older version
of the schema. Created attributes and classes cannot be deleted, and it is only
possible to deactivate them. When restoring Active Directory, you cannot mark the
Schema partition as authoritative.
Tombstones
A recovery plan should take into account the lifetime of the Active Directory
tombstones (60 days, by default; minimal value is 2 days). This parameter is stored
(if it is defined) in the tombstoneLifetime attribute of a directory object named
N=Directory Service,CN=Windows
NT,CN=Services,CN=Configuration,DC=<ForestRoot>. Tombstone is a deleted
object that is maintained in Active Directory during its lifetime, before the system
eventually destroys it. The age of the backup tape should not exceed this period of
time, otherwise the outdated data will be rejected.
1. Run the Backup utility: click Start | All Programs | Accessories | System
Tools | Backup or enter ntbackup in the Run window.
2. Click the Backup tab and check the System State box in the tree pane. (You
can include some files in the backup as well.)
3. Enter the name of the backup file in the Backup media or file name field (keep
the file extension BKF) and click Start Backup.
4. In the Backup Job Information window (Fig. 8.10), enter the necessary data
and click Advanced.
Fig. 8.10: Configuring a backup operation
5. The next window (Fig. 8.11) will allow you to set backup options. The System
State should always be saved as a normal backup. You might want to clear
the Automatically backup System Protected Files with the System State
box set by default if you need a compact backup file without all system files.
Usually, it is enough to have such a compact file (40–50 MB for small
domains) for many operations related to saving/restoring Active Directory. A
full backup of the System State will be about 300 MB in size.
6. Close the Advanced Backup Options window and click Start Backup — the
backup process will begin.
Note Only the full backup will allow you to safely restore a crashed DC. It is possible
to repair the system from scratch in about 30–40 minutes. Restore a domain
controller image from a CD or network drive by using an image-duplicating tool
like Norton Ghost. Boot the server, and restore the full backup file. You will get
a fully operational DC retaining its SID, GUID, and other mandatory Active
Directory parameters.
Restore is a more complicated process than back up. Generally, you have two
options:
There are three different methods of restoring the System State from the backup
media:
Perform a primary restore when you have the only DC in the domain and
want to rebuild this domain. A primary restore builds a new FRS database;
therefore, the restored data will be replicated to other controllers in the
domain.
If there is at least one operational DC in the domain, perform a non-
authoritative (normal) restore. The repaired DC will receive current data
from other DCs through normal replication. The restored data will never be
replicated to other DCs. This is the most used type of restore.
If you want to restore inadvertently deleted Active Directory data and to
replicate these data to the other DCs, perform an authoritative restore. You
cannot perform a "true" rollback, since authoritative restore does not affect
changes made in the directory after the backup was created. These new data
will be replicated to the restored DC.
Remember that, in any case, Active Directory can be restored only when a DC has
been booted into the Directory Service Restore Mode.
Primary Restore
1. Run the Backup utility and open the Restore and Manage Media tab (Fig.
8.12).
Fig. 8.12: Restoring the System State from a backup media
2. Select the necessary media and check the System State box. Files should be
restored to the Original location.
3. Click Start Restore and confirm overwriting current System State in the
Warning pop-up window.
4. Click Advanced in the Confirm Restore window.
5. Set the checkbox shown in Fig. 8.13. Close the window, and begin restore.
6. When the Backup utility will finish and propose you to reboot the computer,
answer positively — reboot the computer into normal mode.
1. Run the Backup utility and perform non-authoritative restore (see the previous
section). When the Backup utility completes its work, it proposes that you
restart the computer (Fig. 8.14). You must click No.
Important This second restore operation as well as Steps 5 and 6 below are
only necessary if you need to authoritatively restore the entire
System State or directory objects along with corresponding Group
Policy Objects. If you restore a single object, skip this step and go
directly to Step 3.
10. Reboot the computer into normal mode and wait until the SYSVOL volume
will be published (look for event ID 13516 in the File Replication Service log
and use the net share command to monitor when the process will be
completed).
11. Copy contents of the SYSVOL volume from the alternative location to an
existing one. These changes of the SYSVOL volume will be the most recent
and, therefore, will be replicated to other DCs as the authoritative data.
In the example shown, an OU object has been restored. You can mark an individual
object (in the Windows .NET environment), subtree, or entire directory partition as
authoritative. This, however, does not extend to the Schema partition.
Caution Use authoritative restore with necessary directory objects only. Be very
selective and do not restore excessive objects. Be especially careful with the
Configuration partition. Do not use the restore database command unless you
completely understand how restore operations work.
Notice the line in bold that indicates an increment of the attribute version numbers,
and two previous lines. The version numbers increase by 100,000 for each day after
the original backup has been performed. You can view changes of metadata by using
ReplMon.exe. In our case, for example, the following command will be used:
By using this command on different DCs, you can verify whether the authoritative
restore was successful, and trace the replication's propagation.
If objects in your Active Directory installation have very low volatility, you might wish
to override the default value of the version increment. Use a command similar to the
following:
Sometimes, administrators forget or simply do not know that each Windows 2000 or
Windows .NET (as well as Windows XP) installation CD contains a pack of powerful
tools named Windows Support Tools. (This pack is the same for both Professional
and Server versions of Windows 2000. Windows .NET servers have more recent
versions of the Support Tools then Windows XP.) This pack must be installed
separately from the operation system itself. Run the Setup.exe or Suptools.msi file
from the \SUPPORT\TOOLS folder, and install the pack on the hard disk. (The
Windows.NET Support Tools require about 20 MB of the hard disk space.) Then you
will be able to start the tools from the Start menu or the command prompt.
The Windows Support Tools can be regarded as a subset of the Windows Resource
Kit, a separately purchased product that contains hundreds of various utilities as well
as comprehensive printed documentation. (There are two versions of the Kit: Server
and Professional. Many of the tools described below are present in both versions.)
The Windows 2000 Resource Kit requires about 60 MB of the hard disk.
The good news is that the Windows 2000 Resource Kits (both Professional and
Server versions including the Windows 2000 Server Deployment Planning Guide)
and Windows XP Professional Resource Kit are freely accessible on the Microsoft
Tech-Net website (see links in Appendix A). Moreover, some very useful tools from
these kits can be also downloaded for free from the Microsoft website (see Appendix
A).
At this time, the Windows .NET Server Resource Kit has not yet been released, so
some of the tools (as well as various administrative scripts) from Windows 2000
Server Resource Kit have been tested in the Windows .NET environment. They
appear to work properly.
The Windows 2000 Server Resource Kit contains a collection of Visual Basic (VB)
scripts called Remote Administration Scripts. Several scripts from this collection are
mentioned in the tables in this chapter. (These scripts can safely run on Windows
.NET servers, too.) If you are going to write your own scripts or applications, pay
close attention to these scripts, since they will help you speed up the process of
studying scripting basics (including ADSI programming concepts).
Classification by Purpose
First, you should become generally acquainted with the existing tools and the
administrative tasks for which they are used. Look at Table 9.1. The tools from the
Windows 2000 Server Resource Kit and Windows .NET Support Tools packs listed in
this table are divided into categories depending on the basic purpose of a tool. In
some cases, the grouping of tools is rather voluntary, since some utilities can be
used for different purposes.
Table 9.1: Windows 2000 Tools Sorted by the Purpose They Serve
Administrative task Tools to be used
Active Directory Migration Tool (ADMT) and AdsVw.exe (from the ADSI SDK) can be
downloaded for free from the Microsoft website (see links in Appendix A). They are
also included in the table. Every tool mentioned here is characterized in Table 9.2.
Table 9.2: Purpose of the Selected Windows 2000 and Windows .NET Tools
See
Toolname Contained in Purpose
chapter
ACLDiag.exe (ACL ST View permissions (ACLs) on a 14
Diagnostics) directory object. Verify delegation
of administrative control, and
whether the object security settings
correspond to the schema defaults.
AddUsers.exe (Add RK Output, create, and delete multiple 8
Users) user accounts. Add users to
Table 9.2: Purpose of the Selected Windows 2000 and Windows .NET Tools
See
Toolname Contained in Purpose
chapter
groups.
ADSIEdit.msc (ADSI ST View and modify Active Directory 7
Edit snap-in) (GUI tool) objects (including application,
schema, and configuration
directory partitions). Set objects'
ACLs.
AdsVw.exe (Active ADSI SDK Same as above, for both Active 12
Directory Browser) (GUI Directory based (Windows 2000
Tool) and Windows .NET) and Windows
NT domains (SAM database).
ClonePrincipal ST Create a copy of a user or group 13
account in a different forest and
retain user or group access rights
to directory objects or shared
resources. (Includes Clonepr.dll,
Clonepr.vbs, Clonelg.vbs,
Clonegg.vbs, Cloneggu.vbs,
SIDHist.vbs tools.)
CreateUsers.vbs RK (RAS) Create multiple user accounts in 8
default or specified containers.
CSVDE.exe (CSV Sys Export and import multiple directory 12
Directory Exchange) objects using a file in CSV format.
DCdiag.exe (Domain ST Diagnose domain controller issues: 10
Controller Diagnostic connectivity, availability of the
Tool) directory and other services,
replication, etc.
DHCPloc.exe (DHCP ST Display active DHCP sewers and 4
Server Locator Utility) detect any unauthorized sewers.
Find DHCP servers available to a
DHCP client.
DNScmd.exe (DNS ST Check and/or modify zones and 4
Server Troubleshooting resource records on a Windows
Tool) 2000/.NET DNS server. Manage
the zones and the DNS server
configuration.
Create/delete an application
directory partition, control partition
replication scope, move a zone to
another directory partition.
Table 9.2: Purpose of the Selected Windows 2000 and Windows .NET Tools
See
Toolname Contained in Purpose
chapter
DsACLs.exe ST View and/or modify permissions 14
(ACLs) on directory objects.
Restore default permissions.
DsAdd.exe* Sys Add to the directory a computer, 8
contact, group, OU, or user object.
DsaStat.exe (DSA ST Compare directory partitions on two 11
Statistics) different domain controllers and
display statistics or :comparisons of
attributes. Global Catalog servers
can also be checked.
DsGet.exe* Sys Retrieve the attributes of a specific 12
object type from the directory.
DsMod.exe* Sys Modify attributes of a specific 12
object type (computer, contact,
group, OU, server, or user).
DsMove.exe* Sys Rename a directory object or move 12
it to another container.
DsQuery.exe* Sys Search the directory for objects of 12
any type and display any attributes
of found objects. The most flexible
command-line search tool.
DsRm.exe* Sys Delete a directory object or an 12
entire subtree.
DumpFSMOs.cmd RK Display the FSMO roles known to 8
the specified domain controller.
EnumProp.exe RK Display some or all attributes —
(including GUIDs, SIDs, and
security descriptor) of an Active
Directory object specified by its
distinguished name. (The LDAP
provider is used.)
GPOTool.exe (Group RK Test consistency of GPOs and 15
Policy Verification Tool) check their replication in a domain.
GPResult.exe (Group RK (Windows View group policy settings applied 15
Policy Results) 2000) Sys to a user and/or computer
(Windows
.NET)
GPUpdate.exe* Sys Re-apply computer and/or user 8
group policy
GrpCpy.exe (GUI Tool) RK Copy users from one group to —
another in the same or another
domain
Table 9.2: Purpose of the Selected Windows 2000 and Windows .NET Tools
See
Toolname Contained in Purpose
chapter
KerbTray.exe (Kerberos RK Display and purge all cached 14
Tray) (GUI tool) Kerberos tickets for authenticated
services
KList.exe (Kerberos RK Same as above. Can purge only 14
List) specified tickets
Ksetup.exe (Kerberos ST Configure Windows 2000 clients to —
Setup) use an MIT Kerberos server
instead of a Windows 2000 domain
KTPass.exe (Kerberos ST Configure a non-Windows 2000 —
Keytab Setup) (UNIX) Kerberos service as a
security principal in the Windows
2000 Active Directory
LDIFDE.exe Sys Export and import one or more 12
directory objects using a file in
LDIF format. Modify attributes of
object(s)
Ldp.exe (Active ST Perform LDAP operations against 12
Directory Administration any LDAP-compliant directory such
Tool) (GUI tool) a Active Directory
ModifyUsers.vbs RK (RAS) Modify specified attributes of —
multiple domain users. An input
text file with defined values can be
used
MoveTree.exe (Active ST Move directory objects, such as 13
Directory Object user accounts, OUs, and universal
Manager) groups from one domain to another
in the same forest
NetDiag.exe (Network ST Test various networking and 11
Connectivity Tester connectivity issues (protocols,
binding, DNS, WINS, and many
others) on client computers
NetDom.exe (Windows ST Manage and verify trusts and 12
Domain Manager) secure channels; join, move, and
remove computer accounts
NLtest.exe (NLTest) ST List domain controllers for a 11
domain, query for, trusted domains,
query and reset secure: channels
between domain computers, force;
replication to Windows NT 4.0
BDCs
NTDSutil.exe (Active Sys Manage Active Directory database 10
Directory Diagnostic files, operations masters, orphaned
Tool) domains and controllers. Perform
Table 9.2: Purpose of the Selected Windows 2000 and Windows .NET Tools
See
Toolname Contained in Purpose
chapter
authoritative restore
NTFRSutl.exe RK Manage the File Replication 11
Service (including SYSVOL and
DFS roots replication)
RepAdmin.exe ST Display replication partners, 11
(Replication Diagnostics metadata and connections, force
Tool) replication of directory partitions,
trigger KCC
ReplMon.exe (Active ST Monitor and force replication, 11
Directory Replication display replication metadata,
Monitor) (GUI tool) topology, and domain controller
information
RPingc.exe (GUI tool), RK Test RPC connectivity between 11
and RPings.exe (RPC clients and RPC servers
Ping: Connectivity
Verification Tool)
SDCheck.exe (Security ST Verify a directory object's ACL 14
Descriptor Check Utility) inheritance and replication of the
security descriptor from one
domain controller to another
Search.vbs ST Search for a object against an 12
LDAP server
Security Administration ST Modify SIDs specified in the ACLs —
tools (SIDWalker) of files, shares, and registry keys.
Grant access rights on objects to
specified users and groups.
(Include ShowAccs.exe,
SIDWalk.exe, and SIDWalk.msc
tools.)
SublnACL.exe RK Display security descriptors for —
files, registry keys, or services.
Change security information such
as owner of an object, domain
name, or SID
UserAccount.vbs RK (RAS) Displays information on normal, —
locked out, and disabled user
accounts in a domain
Note Windows 2000 servers provide a few "traditional" utilities for administering
Windows NT 4.0 domains: Server Manager (srvmgr.exe), User Manager
(usrmgr.exe), and System Policy Editor (poledit.exe). These tools have not
been included in the current version of Windows .NET servers. The Windows
2000 Server Resource Kit also contains the Domain Monitor (dommon.exe). All
named tools are the updated versions that differ from their Windows NT 4.0
counterparts. This may be important in some cases. Windows .NET servers do
not and, most likely, will not contain the utilities listed, but all of them can safely
run on Windows .NET-based computers within AD-based domains.
Table 9.2 lists the file names of the tools as well as their "official" names; a short
description of each tool's characteristics is also given. The table is sorted by the
names of the files, because it is the filename of a tool that you will use most often. In
addition, the name of the pack that contains the tool is specified, along with the
chapter of this book that contains the most complete information about using the tool.
("ST" stands for the Windows .NET Support Tools, "RK" means the Windows 2000
Server Resource Kit, and "RAS" is the abbreviation for Remote Administration
Scripts. "Sys" means that the tool is a standard system tool. These marks are also
present in the subtitles of the following chapters.)
Important Most of the selected tools are contained in both Windows 2000 and
Windows .NET systems and can safely run on both Windows 2000- and
Windows XP/.NET-based computers. The Windows .NET versions of the
tools, as a rule, cannot run on Windows 2000-based computers, so you
need to take into account the limitations specific for each tool. See the
detailed information in the chapter specified.
This utility, as a matter of fact, is a complex test (or more precisely — a set of
specialized tests) that allows an administrator to give a DC a quick "check up" and
locate any possible problems. DCdiag verifies the serviceability of a DC as well as its
relations (connectivity, trusts, replication issues, etc.) with other DCs that are the
replication partners of the selected DC. Thus, the utility primarily checks up parts of
Active Directory at a functional rather than a logical level (i.e., aspects such as data
consistency, semantic contents, etc., are not affected).
It would be a good idea to run DCdiag after and even before (see the description of
the DcPromo and RegisterInDns tests in Chapter 5, "Installing Active Directory")
installation of domain controllers. It is fairly typical — especially in small networks —
for an administrator to successfully (in his or her opinion) install Active Directory on
the first DC and consequently believe that the domain will automatically work
correctly since no faults were detected or error messages received. Problems usually
begin when the administrator adds clients to the domain or installs a second DC (in
the same or a different domain). Apparently, the first (root forest) DC was configured
incorrectly; very often this concerns DNS service (on a Windows 2000/.NET Server
or a third-party server). In such a situation, DCdiag (especially in conjunction with
Net-Diag.exe) could locate many potential problems from the beginning.
The DCdiag utility can generate a very generous output — most of all, with
enterprise-wide tests, and you should therefore use log files for subsequent analysis
of the results. The diagnostic messages are quite informative and very often plainly
specify a problem, so you need only eliminate it without any further analysis.
The Windows .NET version of DCdiag is sufficiently documented. You can use the
built-in Help (dcdiag /?) as a quick reference on all parameters. (The built-in Help
seems to be more accurate than Support Tools Help.) The Windows 2000 Server
Resource Kit contains a great deal more information on how to use this utility. We
shall discuss some of the most interesting features of DCdiag and examples of their
use.
Note For the Windows 2000 environment, it is recommended that you download the
updated version of DCdiag from
http://www.microsoft.com/downloads/release.asp?ReleaseID=22939.
You can run DCdiag from any network computer and test any DC in the forest. Some
tests can be performed under a normal user account (Replications, NetLogons, and
ObjectsReplicated cannot), but to get the full functionality of DCdiag, you must either be
logged on as an administrator (or even as an enterprise administrator) or provide an
administrator's credentials with the command.
In comparison with Windows 2000, the Windows .NET version of DCdiag provides a
few new tests:
CrossRefValidation CheckSDRefDom
VerifyReplicas VerifyReferences
VerifyEnterpriseReferences
These tests are especially informative when used with /a and /e parameters that force
the testing of all DCs in the current site or in the forest, respectively. Using these
tests, you can quickly locate fault elements of the replication infrastructure — invalid
cross-references, improper security descriptors, directory partitions that are not fully
instantiated, etc. — particularly when there are many application directory partitions
deployed in your enterprise.
Standard Full Test
First, let us look at what happens if DCdiag is passed successfully. You will see from
this output how the tests are structured and which tests the DCdiag tool contains.
The Topology, CutoffServers, and OutboundSecureChannels tests are omitted by default, so
you must run them explicitly or use the /c (comprehensive) parameter.
In the Windows 2000 environment, DCdiag runs faster if you specify the DC's DNS
name rather than its NetBIOS name. (If the DC name is omitted, your current logon
server is implied.) The /a or /e parameters specified in a command allow you to run a
selected test on every DC in a site or in the forest.
If you want to retrieve the maximum possible amount of information from DCdiag, use
the /v (verbose) parameter with any test. As well, the /d parameter is equal to /v, and,
in addition, produces plenty of information (pDsInfo) on your forest configuration. With
these parameters, use the more pipe or redirect the output to a file in the current or
another folder with the /f parameter. (The pDsInfo section of tests is never redirected to
a file: use the pipe to save that information.)
The first two sections — Initial setup and Initial required tests — are always executed,
even if you specify only one test. You may first run the full test to find any problems,
which may exist. Then, it's advisable to run tests selectively in verbose mode to get a
detailed diagnosis.
Error and diagnostic messages (in verbose mode) are very descriptive, so it is un-
necessary to give many examples.
The mandatory Connectivity test is executed on every DCdiag test run. This test
verifies the most important functionalities of a domain controller: whether all DNS
resource records are registered on the preferred DNS server, and whether DCs are
pingable and have LDAP/RPC accessibility. For example, using /a or /e parameters,
you can quickly find all DCs that are not responsible. The following output will be
displayed:
C:\>dcdiag /test:connectivity /e
...
Testing server: NET-Site\NETDC2
Starting test: Connectivity
Server NETDC2 resolved to this IP address 192.168.0.2,
but the address couldn't be reached(pinged), so check the
network.
The error returned was: Win32 Error 11010
This error more often means that the targeted server is
shutdown or disconnected from the network
..........................NETDC2 failed test Connectivity
...
The next output sample illustrates errors with DNS registration of the selected DC:
...
Doing initial required tests
As you can see from the foregoing messages, none of the other tests will even be
started if there are any errors in the Connectivity section of DCdiag. You should first
eliminate any existing issues before you continue the diagnosis. To locate the
problem shown, use the netdiag /test:DNS command, and check all warnings in the
"DNS test" section of the output data.
Verifying Replication
C:\>dcdiag /test:Replications /a /v
Only failed replication events will be included in the resulting report. The output of this
command is the following:
Domain Controller Diagnosis
As you can see from the test output, DCdiag provides comprehensive information
about failed connections for each DC in the site and on each directory partition.
If the local DC has not received replication information from a number of DCs within
the configured latency interval (24 hours by default; see Appendix B), messages
similar to the following ones will be included in the output:
To obtain additional information on replication topology, you can also use the repadmin
/showconn command that verifies whether all required connections between DCs were
created.
Application directory partitions that appeared in Windows .NET can generate specific
replication problems, and the Windows .NET version of DCdiag offers new tests for
troubleshooting similar issues. The following example illustrates the VerifyReplicas
test that checks on whether all application partitions have replicas stored on the DCs
specified as replica servers for these partitions. The problem presented here was
caused by missing permissions for the Enterprise Domain Controllers group on the
DC=ForestDnsZones, DC=net, DC=dom partition, and could be easily detected by the
NCSecDesc test. When the proper permissions are missed, the NETDC2 and
NETDC3 domain controllers could not create the replicas of that partition and,
therefore, generate the appropriate replication connections.
C:\>dcdiag /test:VerifyReplicas /a
Enterprise tests check on many elements that are vitally necessary in order for an
enterprise (forest) to work: intersite links, bridgehead servers, FSMO role owners and
their accessibility, etc.
It is not a good idea to run the Intersite test on one DC only, so you must include the /a
(current site) or /e (entire enterprise) parameters.
Here is a snippet of the test output for two sites (NET-Site and Remote-Site) in the forest
net.dom (some lines are in bold for clarity):
C:\>dcdiag /test:Intersite /e /v
...
This utility is automatically installed into every domain controller (in the %System-
Roor%\system32 folder). One could hardly say that this tool is for everyday use, but
every administrator must be familiar with its features since it is used in certain
operations that are very important for Active Directory functioning, such as Active
Directory restore, offline defragmentation, FSMO role manipulating, and so on.
However, NTDSutil has become one of the major tools for deploying and maintaining
application directory partitions introduced in Windows .NET.
Some commands on the NTDSutil's main menu can only be performed when the
system is booted in the Directory Services Restore Mode (press <F8> at system
startup). (If, nevertheless, you wish to enable them, set the environmental variable
SAFEBOOT_OPTION=DSREPAIR, and restart the utility. This is, however, not advisable,
because conflicts with the running processes will not permit you to execute most of
the available operations.) The following commands are prohibited when the Active
Directory services are online:
Authoritative restore
Files
Semantic database analysis
Configurable Settings
Set DSRM Password
The IP Deny List command, available in Windows 2000 version, might not be included
in Windows .NET.
Commands used in NTDSutil are quite long, but the utility accepts truncated syntax
(or you can easily copy-and-paste commands from the built-in help messages). For
example, the command
could be shortened to
co t s xxx
NTDSutil can be called from command files. An example of the invocation method is
the DumpFSMOs.cmd file described in the Chapter 8, "Common Administrative
Tasks".
Let's discuss the purpose and use of all NTDSutil's commands in the order in which
the corresponding menus appear in the built-in Help.
Note For presentation purposes, the command's prompts in the given dialogs are
shown in bold.
In the Windows 2000 environment, the utility connects to DCs faster if you use
the DNS rather than NetBIOS names of domain controllers.
Authoritative Restore
Here, we will only look at the command that lists all cross-reference objects
associated with domain partitions instantiated on the local domain controller. You
cannot restore a partition if the corresponding cross-references is absent or has not
been created. The following example shows two application partitions and three basic
partitions:
1) Partition: DC=DomainDnsZones,DC=net,DC=dom
cross-ref: CN=352cf7f5-327d-4316-9cb7-31c922273752,
CN=Partitions,CN=Configuration,DC=net,DC=dom
2) Partition: DC=ForestDnsZones,DC=net,DC=dom
cross-ref: CN=3d9c5cba-34b5-4692-b43a-fa7a17161785,
CN=Partitions,CN=Configuration,DC=net,DC=dom
3) Partition: CN=Configuration,DC=net,DC=dom
cross-ref: CN=Enterprise Configuration,
CN=Partitions,CN=Configuration,DC=net,DC=dom
4) Partition: CN=Schema,CN=Configuration,DC=net,DC=dom
cross-ref: CN=Enterprise Schema,
CN=Partitions,CN=Configuration,DC=net,DC=dom
5) Partition: DC=net, DC=dom
cross-ref: CN=NET,CN=Partitions,CN=Configuration,DC=net,DC=dom
Done.
authoritative restore: ...
Configurable Settings
NTDSutil allows you to tune some parameters Active Directory functioning is affected
by. In the current version, this concerns only two settings that control TTL (Time-To-
Live) values for dynamic objects (see details in Chapter 2, "Active Directory
Terminology and Concepts" and Appendix B).
The following dialog illustrates how to view the current values of these parameters
(first, you must be connected to a DC) and increase the value of DynamicObject-
MinTTL:
Domain Management
The Windows .NET version of NTDSutil contains a lot of new commands in the
Domain Management menu, since NTDSutil is the main tool for manipulating application
directory partitions (see Chapter 2, "Active Directory Terminology and Concepts").
Essentially, the process of deploying application partitions is not too complicated: you
can create and remove partitions, and add and remove the replicas of these
partitions. To verify all similar operations, use the DCdiag tool and repadmin /showconn
command.
Important See also the description of the Dnscmd.exe utility in Chapter 4, "Windows
.NET DNS Server," since only this utility can perform some important
operations with application directory partitions.
First, you may wish to view all directory partitions stored on the selected DC. As you
can see from the following sample output, the partitions list contains two built-in
application partitions (DC=ForestDnsZones, DC=net, DC=dom and DC=DomainDnsZones,
DC=net, DC=dom) created by default on the first DC in the forest if the DNS server is
running on the same DC. These partitions are not specifically marked in the list.
The following command lists all replicas for the specified partition (the command is
applicable to application partitions only):
When you create a new partition, the appropriate DNS entries are automatically
registered on the preferred DNS server. The distinguished name (DN) of the new
partition is added to the namingContexts attribute of the RootDSE object on each DC
that stores a replica of that partition. So you can test creation or deleting naming
contexts with Ldp.exe tool.
The operation was successful. The partition has been marked for removal
from the enterprise. It will be removed over time in the background.
Note: Please do not create another partition with the same name until
the servers which hold this partition have had an opportunity to remove
it. This will occur when knowledge of the deletion of this partition has
replicated throughout the forest, and the servers which held the
partition have removed all the objects within that partition. Complete
removal of the partition can be verified by consulting the Directory
event log on each server.
domain management: ...
Adding and Removing Partition Replicas
If the replica has been successfully created, the new context is added to the
replication connection with the specified DC. You can verify this with the
repadmin/showconn command or the Active Directory Sites and Services snap-in.
The appropriate KCC and NTDS Replication messages should appear in the
Directory Service log:
Verify the operation result with the List command and Event Viewer snap-in (Event
Source: NTDS KCC; Event ID: 1482):
...
The following directory partition is no longer available on the domain
controller at the following network address.
Directory partition:
DC=App-Part, DC=net, DC=dom
Domain controller:
CN=NTDS Settings, CN=NETDC2, CN=Servers, CN=NET-Site, CN=Sites,
CN=Configuration, DC=net, DC=dom
...
Creating Cross-Reference Objects
C:\>ntdsutil
ntdsutil: Domain management
domain management: Connections
server connections: Connect to server netdc1
Binding to netdc1 ...
Connected to netdc1 using credentials of locally logged on user.
server connections: Quit
domain management: Precreate DC=intra, DC=subdom, DC=net, DC=dom
netdc4.intra.subdom.net.dom
adding object CN=intra, cn=Partitions, CN=Configuration, DC=net, DC=dom domain management:
List
Note: Directory partition names with International/Unicode characters will only display correctly if
appropriate fonts and language support are loaded
Found 7 Naming Context(s)
0 - CN=Configuration, DC=net, DC=dom
...
6 - DC=intra, DC=subdom, DC=net, DC=dom
domain management: ...
As you can see from the dialog, a new domain context appears after the command
has been executed. Also, note that the NETDC4 domain controller specified in the
command does not yet exist in the forest and must be promoted in future.
The commands in the Files menu allow you to perform the following operations:
Retrieve information on the state of the Active Directory (Jet) database (the
ntds.dit file) as well as the log files
Move database and/or log files to another location
Re-define paths for Active Directory files
Check up the Active Directory integrity
Perform database recovery
Attention You can move an already installed Active Directory database and/or log
files to another location (folder or disk), but it is not possible to change
the SYSVOL's location without re-installing Active Directory on a domain
controller.
Retrieving Information on Active Directory Files
The following command informs you about the size and location of all Active
Directory database files. It is advisable that you use the command (and thus verify
the presence of the log files) after you have restored Active Directory or done
maintenance operations (offline defragmentation, moving files, etc.).
Drive Information:
This entire procedure is shown below. In this scenario, the database file is packed to
a temporary C:\AD\CompactDB folder, and all log files are stored in the default
location — D:\WINDOWS\NTDS.
/p /o
You may wish to move Active Directory database files to another location due to disk
space limitations or disk volume reconfiguration. The procedure for moving the
database file requires the following steps:
The procedure for moving log files is similar to the one described above.
Security of the folder where the Active Directory database files are stored (by default
— %System Root%\NTDS) is very important for proper Active Directory functioning.
The Set default folder security command resets mistakenly changed permissions on that
folder to default values.
Database Integrity
The Files menu also contains two commands — Recover and Integrity — that can be
used to detect corruption of the Active Directory database (with respect to the ESENT
database semantics) and to perform some operations for its recovery. The Windows
2000 version of NTDSutil also contains the Repair command in the Files menu. (All of
these commands may require a lot of time to run; this primarily depends on the actual
size of the database.) The Repair command should not be run without first consulting
with service personnel, since it can result in data losses. The Recover command
should be run first, prior to the Integrity command. This command scans the log files
and ensures that all transactions are committed. The Integrity command can then
check the database file for low-level corruption. The command's output will be similar
to the following:
file maintenance:...
IP Deny List
The IP Deny List command is available in the Windows 2000 version of NTDSutil, but
may not be in the Windows .NET version. If it is not, you can manually configure the
list of IP addresses using the ADSI Edit snap-in (see Appendix B).
To increase the security of a DC, an administrator can use the IP Deny List command
that is applied only to the Default-Query Policy object (see also the next section).
This list contains IP addresses, from which a domain controller will not accept LDAP
queries. A list entry can represent a single host or a subnet. For example, the
command
LDAP Policies
Using the following example, let us discuss how NTDSutil allows an administrator to
work with the Default-Query Policy object (see Chapter 1, "Active Directory Concepts
and Terminology"). A dialog is shown that changes the Initial Receive Timeout from the
default value of 120 to 30 (the changed value is put in bold italics).
Policy Current(New)
MaxPoolThreads 4
MaxDatagramRecv 1024
MaxReceiveBuffer 10485760
InitRecvTimeout 120(30)
MaxConnections 5000
MaxConnIdleTime 900
MaxPageSize 1000
MaxQueryDuration 120
MaxTempTableSize 10000
MaxResultSetSize 262144
MaxNotificationPerConn 5
The Windows 2000 Server Resource Kit contains the ModifyLDAP.vbs script (which
is included in the Remote Administration Scripts). This script allows an administrator
to display policy settings, create new policies, and modify existing ones, as well as
assign policies to a DC or site. Here is the screen output for the LDAP Administrative
limits of the Default Query Policy, which is installed and used (even if not selected) by
default on all DCs:
Normally, the process of demoting a DC involves deleting the computer account and
cleaning up all metadata related to that DC from Active Directory. When the last DC
in a domain is deleted, all cross-references (and other information about that domain)
are also removed. There are, however, situations when a domain controller is
decommissioned incorrectly (or failed and destroyed), and orphaned metadata
remains in the directory. In such a case, you can remove information about the
retired DC and/or domains by using NTDSutil. (You must not delete any information
for existing domains and DCs!) In general, the procedure requires the following steps:
The following dialog illustrates how you can remove a retired domain controller
(NETDC2) and a child domain (subdom.net.dom) from the forest (net.dom). (In this
example, the shortened command syntax is used; comments are in bold square
brackets. You can also learn how to select an operation target, which is used in many
commands.)
C:\>ntdsutil
ntdsutil: m c
metadata cleanup: c
[First, we must be connected to a DC:]
server connections: co t s netdc1
Binding to netdc1 ...
Connected to netdc1 using credentials of locally logged on user.
server connections: q
metadata cleanup: s o t
[Second, we must select an object to delete:]
select operation target: l si
Found 1 site (s)
0 - CN=NET-Site, CN=Sites, CN=Configuration, DC=net, DC=dom
select operation target: s si 0
Site - CN=NET-Site, CN=Sites, CN=Configuration, DC=net, DC=dom
No current domain
No current server
No current Naming Context
select operation target: l d
Found 3 domain (s)
0 - DC=net, DC=dom
1 - DC=subdom, DC=net, DC=dom
2 - DC=dotnet, DC=dom
select operation target: s d l
Site - CN=NET-Site, CN=Sites, CN=Configuration, DC=net, DC=dom
Domain - DC=subdom, DC=net, DC=dom
No current server
No current Naming Context
select operation target: l se f d i s
Found 1 server (s)
0 - CN=NETDC2, CN=Servers, CN=NET-Site, CN=Sites, CN=Configuration, DC=net, DC=dom
select operation target: s se 0
Site - CN=NET-Site, CN=Sites, CN=Configuration, DC=net, DC=dom
Domain - DC=subdom, DC=net, DC=dom
Server - CN=NETDC2, CN=Servers, CN=NET-Site, CN=Sites, CN=Configuration, DC=net, DC=dom
DSA object - CN=NTDS Settings, CN=NETDC2, CN=Servers, CN=NET-Site, CN=Sites,
CN=Configuration, DC=net, DC=dom
DNS host name - netdc2.subdom.net.dom
Computer object - CN=NETDC2, OU=Domain
Controllers, DC=subdom, DC=net, DC=dom
No current Naming Context
[Now, we have selected the NETDC2 server from the subdm.net.dom domain
for subsequent operations:]
select operation target: q
metadata cleanup: r s s
[The following Server Remove Confirmation Dialog may appear - you must click Yes.]
[The Server Remove Confirmation Dialog will appear - you must click Yes.]
Now the subdom.net.dom domain has been deleted, and you can verify this by using
the Event Viewer snap-in. There are many information messages (from NTDS KCC
and NTDS Replication sources: ID 1123, 1104, 1270, 1658, 1746, etc.) that appear in
the Directory Service log (the source is NTDS KCC) and accompany removing
domain controllers, naming contexts, and replication connections. There is no need
to explain them specifically.
To verify that the operation was carried off successfully, you may also check the
domain configuration by using the following tools: Active Directory Domains and
Trusts, ADSI Edit (the Configuration container: the Partitions and Sites | Servers
nodes), and Active Directory Sites and Services snap-ins. You may also run
DCdiag.exe (as well as repadmin /showreps) to ensure that there are no replication
problems.
Attention When deleting child domains, you must also manually delete the
corresponding entries from the DNS server.
Seize role — this command designates the connected server as the specified
role master. The command must be used only when the DC — the current
master — has severely crashed and cannot be repaired.
Transfer role — this command "moves" the specified role from the current role
holder to the connected server (DC). You can perform the same operation by
using various administrative snap-ins (see Chapter 7). The NTDSutil.exe also
allows you to carry out the operation in batch mode (see DumpFSMOs.cmd).
Transferring a Role
If for some reason you cannot (or do not want to) use the standard administrative
snap-ins, you may use NTDSutil to transfer a role from its current owner to another
DC. The most common steps are the following:
Note It is not advisable to seize a FSMO role if you can transfer this role. Seizing is
used only when a FSMO role owner has failed and is unrecoverable.
In the following dialog, the Schema Master role is transferred to the netdc2.
subdom.net.dom server. (This is only an example! It is neither practical nor advisable to
move the schema master role to a child domain.)
C:\>ntdsutil
ntdsutil: Roles
fsmo maintenance: Connections
server connections: connect to server netdc2.subdom.net.dom
Binding to netdc2.subdom.net.dom ...
Connected to netdc2.subdom.net.dom using credentials of locally logged on user
server connections: Quit
fsmo maintenance: Transfer schema master
[The Role Transfer Confirmation Dialog will appear - click Yes.]
Even if the connected DC already possesses the specified role, the command dialog
remains the same as shown above. You can verify the requested operation with the
Directory Service log. A message similar to the following one should appear (Event
Source: NTDS Replication; Event ID: 1458):
The operations master role represented by the following object has been
transferred to the following domain controller at the request of a user.
...
Seizing a Role
Suppose a DC that holds the Infrastructure FSMO role was destroyed, and you want
this role to be designated to another DC. The following dialog shows how to forcibly
transfer the role to a new candidate (server netdc1.net.dom) (comments are in bold
square brackets):
C:\>ntdsutil
ntdsutil: Roles
fsmo maintenance: Connections
server connections: Connect to server netdc1.net.dom
Binding to netdc1.net.dom ...
Connected to netdc1.dom using credentials of locally logged on user
server connections: Quit
fsmo maintenance: Seize infrastructure master
The Role Seizure Confirmation Dialog will appear — click Yes.]
[First, the server tries to carry out the standard role transfer
operation and fails. The same error message will appear every time you
want to perform a role transfer operation while the current master is
not operational.]
Attempting safe transfer of infrastructure FSMO before seizure.
ldap_modify_sW error 0x34 (52 (Unavailable).
Ldap extended error message is 000020AF: SvcErr: DSID-03210260, problem
5002 (UNAVAILABLE), data 1753
Win32 error returned is 0x20af(The requested FSMO operation failed. The
current FSMO holder could not be contacted.)
)
Depending on the error code this may indicate a connection,
ldap, or role transfer error.
Transfer of infrastructure FSMO failed, proceeding with seizure ...
Server "netdc1.net.dom" knows about 5 roles
...
Infrastructure - CN=NTDS Settings,CN=NETDC1,CN=Servers,
CN=Site,CN=Sites,CN=Configuration,DC=net,DC=dom
fsmo maintenance: ...
When a FSMO role is seized, the following message will appear in the Directory
Service log (Event Source: NTDS Replication; Event ID: 1837):
...
An attempt to transfer the operations master role represented by the following object failed.
...
Since duplicated SIDs appear, though rarely (due to problems with the RID Master
role owners), you may wish to verify a domain for conflicting SIDs. The commands in
the Security Account Management menu will help you to solve this problem.
Semantic Database Analysis
The commands in this menu test the directory database with respect to Active
Directory (not ESENT database!) semantics. The report generated (a file named
dsdit.dmp.nnn) displays the number of active objects, including phantom and deleted
records. The log file is placed in the current folder.
Notwithstanding the fact that Microsoft does not recommend that end users run
semantic analysis commands themselves, it may be useful to check the database's
integrity in some situations, and fix possible errors. (Be careful with the Go Fixup
command — your data face a risk here!) For example, the following two consecutive
commands have detected and fixed an error with deleted reference objects:
Done.
semantic checker: Go
Fixup mode is turned off
...
Processing records..Done. [No errors now.]
All tools described in this chapter consider Active Directory to be a distributed data
base that along with serving clients must support its own integrity and consistency.
This global system task has different aspects, or problem areas, the most important
of which are the following:
As you can conclude from the list of problem areas, there are many sources of
possible faults, which can prevent Active Directory services from working and
responding to client queries properly. The tools described below help administrators
to test Active Directory's network infrastructure and monitor its state on different
domain controllers.
The NLTest tool helps administrators to manage both Windows 2000 native and
mixed mode (with Windows NT 4.0 BDCs) domains as well as Windows .NET
(version 2002) mode domains. The tool has a number of options including the
following:
Note With most commands of the Windows 2000 version of the NLTest, it is
preferable to specify DNS rather than NetBIOS names of computers.
Some options of NLTest are similar to the options realized in the NetDom tool.
(See Chapter 12, "Manipulating Active Directory Objects.") You may choose the
tool that is the most appropriate for your specific tasks.
Verifying Secure Channels
First of all, you should not confuse transitive Kerberos trust relationships (established
in Windows 2000 and Windows .NET domains) with non-transitive secure channels
(trust links). Although you can, for example, log on to a domain that belongs to one
forest tree on a computer that has a machine account in another forest tree, this does
not mean that domain controllers from the corresponding domains have direct trust
relationships. (You can, however, manually establish such a relationship named a
shortcut trust. See Chapter 5, "Deploying Active Directory.") That is why you can only
verify secure channels directly between a child and its parent domain, or between
tree root domains.
Normally, you should get the following result on every domain computer:
C:\>nltest /query
Flags: 0
Connection Status = 0 0x0 NERR_Success
The command completed successfully
This output means that the computer has been authenticated by a domain controller,
and a secure channel exists between the client computer and the domain controller.
If a user has been logged on locally, or for some reason a network logon has not
been performed (e.g., the DC has not been found, and so on), you will see the
following message:
The following message indicates that the Netlogon service failed to start or is not
running on the computer (since it is stopped or disabled):
In that case, you should open the Services snap-in and check the status of the
service.
If the domain computer account has been reset, NLTest will respond with the
message:
If the account is re-enabled, restart the Netlogon service on the computer or run the
nltest /sc_reset command (see below).
To verify a secure channel or find the logon server, use the nltest /sc_query command,
for example:
C:\>nltest /sc_query:net.dom
Flags: 30 HAS_IP HAS_TIMESERV
Trusted DC Name \\netdc1.net.dom
Trusted DC Connection Status Status = 0 0x0 NERR_Success
The command completed successfully
you may try to log off and log on to the system, or to reset (re-establish) a secure
channel by using the following command:
C:\>nltest /sc_reset:net.dom
If there are multiple DCs in the domain, the client computer will establish a secure
channel with the DC that responds first.
Note For verifying and resetting secure channels, it is also possible to use the netdom
/VERIFY and netdom /RESET commands.
Now let us consider a specific scenario. Suppose you have two domains in the forest
— a child and a parent — and want to test whether the domain controller
netdc1.net.dom from the parent domain will be authenticated by the child domain
subdom.net.dom, i.e., whether the trusts between domains is in the proper state (the
child must trust the parent and vice versa). You use the following command, and for
some reason it fails:
You could check this trust in another way. Run the Active Directory Domain and
Trusts snap-in, open the Properties window for the domain net.dom, and click the
Trusts tab. Select the child domain subdom.net.dom in the Domains that trust this
domain (incoming trusts) list and click Properties, and then Validate[1]. (For an
alternate way to start verification, you can: run the Active Directory Users and
Computers snap-in on a DC located in the child domain, point to the System
container, and open the Properties window for the object net.dom of the Trusted
Domain type. Then click Validate.) The system will display a window shown in Fig.
11.1. (In Windows 2000, the window, though similar, has a different design; however,
the sequence of operations will be same.)
Figure 11.1: This window informs you that the secure channel between two DCs in
related domains is broken, but you can reset it
If you select Yes, reset the trust passwords, provide the administrator's credentials,
and click OK. The system will try to reset the secure channel that failed.
The following command will help you to repair the secure channel from the command
prompt:
To troubleshoot authentication issues, you can test necessary domain controllers and
clients in a similar manner and locate the source of the problems.
Using NLTest, you can display all trust relationships that have been established
between the current domain and other domains in the same or another forest.
Verbose mode allows you to view domain SIDs and GUIDs. Look at a sample output:
C:\>nltest /trusted_domains /v
List of domain trusts:
0: SUBDOM subdom.net.dom (NT 5) (Forest: 2) (Direct Outbound)
(Direct Inbound) (Attr: 0x20)
Dom Guid: 5bcbeeb3-e619-40a6-86b9-4e3d3d9647b2
Dom Sid: S-1-5-21-1193178465-209799049-3125462871
1: W2K w2k.dom (NT 5) (Direct Inbound)
Dom Sid: S-1-5-21-2025429265-113007714-1060284298
2: NET net.dom (NT 5) (Forest Tree Root) (Primary Domain) (Native)
Dom Guid: 941fecfd-d067-472b-9253-a3ce94f43b3e
Dom Sid: S-1-5-21-2033051489-2658513307-2223184096
The command completed successfully
How should you analyze the displayed information? From these output lines, you can
conclude the following:
Note This command does not distinguish Windows 2000 domains from Windows
.NET domains and marks them both as NT 5. Also, the command cannot
discern Windows 2000 native mode from Windows .NET (Windows 2002) mode
(functional level).
Information about the site (in a multiple site network) a client computer is connected
to is not configured on that computer in any way. (The site is selected on the basis of
client and subnet IP address data.) The following command will help you to find the
site to which the local or remote computer has been connected after it has been
booted and logged on to the domain:
C:\>nltest /dsGetSite
NET-Site
The command completed successfully
Sometimes, a domain controller can serve more than one site. (If a new site has
been created but you did not move a DC to that site, some DC from an existing site
will be selected to serve the new site. To increase network fault-tolerance, you can
also intentionally configure a DC to serve a site when the domain controllers of that
site are unavailable.) The following command lists all sites, which the DC can serve:
C:\>nltest /DClist:net.dom
Get list of DCs in domain 'net.dom' from'\\netdc1.net.dom'.
netdc1.net.dom [PDC] [DS] Site: NET-Site
netdc4.net.dom [DS] Site: NET-Site
nt4bdc5
The command completed successfully
Servers present in this list may be offline! (Notice that the PDC is marked. To find the
PDC, you can also use the nltest /DCname:<NetBIOSDomainName> command.) Notice
also that a Windows 4.0-based BDC nt4bdc5 has no directory service and is not
connected to the site topology.
You can add the/FORCE parameter, and the command will try to find another
(different) DC with a specified property (if this is possible).
The Windows .NET version of NLTest offers a new option that performs the same
actions as the /dsGetDC parameter provides (this option uses another system call —
DsGetDcOpen):
Note that the command displays the TCP/IP port number (389) used for access to the
service specified.
Note To find all GC servers in the forest, use ReplMon or query the DNS server for
records in the gc._msdcs.<forestDNSname>subdomain, e.g.:
C:\>nslookup gc._msdcs.net.dom
Server: netdc1.net.dom
Address: 192.168.0.1
Name: gc._msdcs.net.dom
Addresses: 192.168.0.1, 192.168.0.2
Note that all GC servers register their IP addresses in the same DNS subdomain
regardless of which domain they belong to, and you should always search for a GC
server by specifying the DNS name of the forest root domain.
Note For discovering domain controllers you can also use the netdiag /test:DcList and
netdiag /test:DsGetDc /v commands.
Miscellaneous Options
You can use NLTest as an analog to the Shutdown.exe command (from the
Resource Kit). The following command issues a warning message to the computer
netdc4.net.dom and shuts it down in 60 seconds:
Notice that the command converts the entered value into local time rather than UTC.
[1]
In Windows 2000, the buttons have other names; however, the procedure, in
general, is the same.
NetDiag is a powerful tool that can be used for diagnosing practically any network
problem — from physical connectivity to name resolving and authentication. To see a
complete list of NetDiag's options (tests), enter netdiag /? at the command prompt. You
can run all tests, a selected test, or all tests except those specified. The test
diagnosis messages are quite explanatory (especially in verbose and debug modes).
You should pay particular attention to the lines with [FATAL] and [WARNING] tags. All
fatal problems must be fixed, or the system will not be able to work properly. You
need to analyze the warnings and find (and maybe repair) their causes. The
warnings, however, can sometimes be safely ignored.
Two options of NetDiag have already been discussed in Chapter 5, "Installing Active
Directory." These tests (DcList and DsGetDc) can be useful for running before
promoting a server to a DC or joining a client computer (workstation or server) to a
domain. In this chapter, we will consider a successful test run (the result output that
you need to get for every domain computer to work properly) and fixing DNS issues.
Caution The original Windows 2000 version of NetDiag does not run on Windows
XP/.NET systems. The Windows .NET version of NetDiag will not run on
Windows 2000-based computers.
Note For the Windows 2000 environment, it is recommended that you download the
updated version (from July 5, 2001) of NetDiag from
http://www.microsoft.com/downloads/release.asp?ReleaseID=31169.
Running Tests
Let us look at a sample test output that has been obtained by a domain administrator
on a domain controller (netdc1.net.dom). (If a domain user runs NetDiag on his or her
computer, the results will be slightly different since a normal user does not have all
administrative rights.) Notice that the computer has no WINS settings. You may wish
to compare this output with results obtained on domain client computers and analyze
the differences. (Comments are given in bold brackets.)
C:\>netdiag
....................................
Computer Name: NETDC1
DNS Host Name: netdc1.net.dom
System info : Windows 2000 Server (Build 3621)
Processor : x86 Family 6 Model 8 Stepping 3, GenuineIntel
List of installed hotfixes :
Q147222
Netcard queries test.......: Passed
If NetDiag detects that registration of some SRV records has failed for a domain
controller, you can try to fix the problem automatically. Executing the netdiag /fix
command yields the same result as restart of the Netlogon service would. The
command looks up all DNS records in the
%SystemRoot%\system32\config\netlogon.dns file and updates the corresponding
records on the DNS server. When the command runs, strings similar to the following
will appear in the 'DNS test' section:
You can analyze the command output to see which records were incorrect or absent.
After NetDiag has tried to fix the DNS issues, run it once more to be sure that all the
problems have been solved.
Attention Remember that only the ipconfig /registerdns command re-registers the
computer's A (host) record on the DNS server in both forward and reverse
zones. (On Windows XP /.NET- based computers, you can refresh DNS
registration as well as clear the DNS requestor's cache, if you open the
Local Area Connection Status window, and click Repair on the
Support tab.) Run it before NetDiag, since the netdiag /fix command only
affects SRV records.
Attention Do not forget to clear the cache on the DNS server specified as primary
after executing the netdiag /fix or ipconfig /registerdns commands! (If you don't,
you must at least manually delete the records re-registered by these
commands from the cache.) Even though the commands may have
already updated the information in dynamic zones on the authoritative
DNS server, the cache may still contain the old data for some records. As
a result, it might seem that the problems still exist, since while testing, the
commands use the cached responses from the primary DNS server. You
may also need to clear the requester's (local) cache by using the ipconfig
/flushdns command.
The RPC Ping tool verifies remote procedure call (RPC) connectivity on a network.
The tool consists of the following components:
The filenames of these components and the supported systems are listed in the table
below.
Server component
Rpings.exe Windows .NET, Windows 2000, and Windows NT
Client component
Rpingc.exe (32-bit Windows .NET, Windows XP, Windows 2000, Windows
version) NT, Windows 9x /ME
Rpingc 16.exe (16-bit Windows 3.1x
version)
The server component performs only two RPC functions: Echo and Stats. You can
run it with all available protocols or select only one protocol (-p parameter). If, for
instance, only the TCP/IP protocol is installed on the server computer, R Pings.exe
displays the following messages while starting (the names of endpoints are shown in
bold; these names will be displayed by clients later — see Fig. 11.2):
Figure 11.2: This window contains the result of a few successful pings
C:\>rpings
+endpoint \pipe\rping on protocol sequence ncacn_np is set for use.
-protocol Sequence ncacn_nb_nb not supported on this host
+endpoint rping on protocol sequence ncalrpc is set for use.
+endpoint 2256 on protocol sequence ncacn_ip_tcp is set for use.
-protocol Sequence ncacn_nb_tcp not supported on this host
-protocol Sequence ncacn_spx not supported on this host
+endpoint 2256 on protocol sequence ncadg_ip_udp is set for use.
-protocol Sequence ncadg_ipx not supported on this host
-protocol Sequence ncacn_vns_spp not supported on this host
Now the server is ready to respond to RPC requests (until you stop it), and can serve
as many clients as you want.
The client component displays all information about the established RPC connection.
It has two modes of operation:
Ping Only (default) — can be one step or continuous (until you click Stop).
Endpoint Search — a one-time operation that allows you to find all available
(responding) endpoints on the RPC server.
Note Notice that RPingc.exe does not appear on the task pad.
An example of the RPingc's window is shown in Fig. 11.2. (I would recommend that
you specify, in turn, both the DNS and NetBIOS names of a RPC server in the
Exchange Server field. This is because the results may vary depending on the type
of specified name and type of the selected operation.)
A sample result of the Endpoint Search operation is shown below. (The settings
Protocol Sequence = ANY and Endpoint = Rping were selected.)
Successful RPC binding using these parameters:
network address = netdc4.net.dom
endpoint = \pipe\rping
UUID =
The displayed "FOUND:" strings depend on the types and number of endpoints
created on the target computer by RPings.exe.
If a RPC Ping client cannot find the specified server or bind to it using the selected
protocol sequence, the following string will appear after all diagnostic messages:
Some problems will cause the appearance of pop-up error windows, which may
contain the return code and the "Unknown exception" message.
To verify authenticated RPCs, check the Run with Security box. Normally, this
should not affect the results of any operations.
NTFRSutl.exe (RK)
This command-line tool is practically undocumented. You can enter its name at the
command prompt and get a list of parameters. This is all the information you have at
your disposal. NTFRSutl produces a lot of rather cryptic data. Nevertheless, this tool
may be very useful for monitoring, troubleshooting, and — to some extent —
managing the File Replication Service (FRS) that replicates the System Volume
(SYSVOL) information and Distributed File System (DFS) data. The tool can be run
on a local as well as a remote DC.
Note NTFRSutl has been included in the Windows 2000 Service Resource Kit. Some
Beta versions of Windows .NET server family have also comprised this tool.
ntfrsutl ds and ntfrsutl sets — these commands display the FRS configuration
(replication partners, file filters, schedules, etc.). This information can be
partially viewed in the Active Directory Users and Computers snap-in (see
the File Replication Service node in the System container, and the objects of
FRS Sub-scriptions type, which every domain controller has).
ntfrsutl stage — this command displays the disk space currently being used by
replicated objects. Normally, when the configuration is stable, this space is 0
KB. Allocated space means some data have not yet been replicated. The
following two commands allow you to see which specific data are to be
replicated.
ntfrsutl outlog and ntfrsutl inlog — these commands usually display no data. If there
are objects to be replicated, the logs contain information that can be useful to
an administrator, such as an object file name, and date and time of changes.
ntfrsutl poll /now — this command can override the current schedule and trigger
replication of staging data between the current or any specified DC and its
partners. Then, you can check logs or staging areas to make sure that all data
have been replicated.
The administrator can test either an entire directory partition or a subtree only. By
default, all objects are compared, but it is possible to use a LDAP filter and choose
only necessary types of objects. Moreover, you can test either all or only selected
attributes, or the attributes replicated to Global Catalog. Thus, DsaStat can serve as
an instrument for verifying replication between domain controllers and actual
information stored on a DC.
Tip In the Windows 2000 environment, use the servers' DNS rather than NetBIOS
names, and the tool will run faster.
Tip The tool may require quite a lot of time to run, and it is difficult to interrupt it.
Besides, it produces significant network traffic. Therefore, if you plan to use it, do
so carefully.
Let us first see how DsaStat compares directory replicas and produces statistical
data. In this mode, the tool only counts the directory objects and displays totals. In
the following example, the Configuration partition is verified on DCs from different
domains. (It might be necessary to specify a domain administrator's credentials.) If
the −b parameter has been omitted, all applicable partitions are compared.
C:\>dsastat -s:netdc1.net.dom;netdc2.subdom.net.dom
-b: CN=Configuration, DC=net, DC=dom
Stat-Only mode.
Unsorted mode.
Opening connections...
netdc1.net.dom...success.
Connecting to netdc1.net.dom...
reading...
**> ntMixedDomain = 0 [0 --- native mode]
reading...
**> Options = 1 [1 --- Global Catalog server]
Setting server as [netdc1.net.dom] as server to read Config Info...
netdc2.subdom.net.dom...success.
Connecting to netdc2.subdom.net.dom...
reading...
**> ntMixedDomain = 1 [1 --- mixed mode]
reading...
**> Options = 0 [0 --- "normal" server]
[If options have not been defined, you will see the following line:
LocalException <0>: Cannot get Options <2>.]
Generation Domain List on server netdc1.net.dom...
> Searching server for GC attribute partial set on property attributeId.
> Searching server for GC attribute partial set on property
ldapDisplayName.
Retrieving statistics...
[The command can be cancelled only from this point and afterwards:]
Paged result search...
Paged result search...
50 entries processed (7 msg queued, 0 obj stored, 0 obj deleted)...
...
2650 entries processed (7 msg queued, 0 obj stored, 0 obj deleted)...
...(Terminated query to netdc1.net.dom. <No result present in message>)
...(Terminated query to netdc2.subdom.net.dom. <No result present in
message>)
2700 entries processed (6 msg queued, 0 obj stored, 0 obj deleted)...
...
2950 entries processed (6 msg queued, 0 obj stored, 0 obj deleted)...
configuration 1 1 2
container 61 61 122
controlAccessRight 58 58 116
crossRef 6 6 12
crossRefContainer 1 1 2
dSUISettings 24 24 48
displaySpecifier 1296 1296 2592
foreignSecurityPrincipal 16 16 32
interSiteTransport 2 2 4
interSiteTransportContainer 1 1 2
licensingSiteSettings 1 1 2
lostAndFound 1 1 2
mSMQEnterpriseSettings 1 1 2
msPKI-Enterprise-Oid 1 1 2
nTDSConnection 4 4 8
nTDSDSA 2 2 4
nTDSService 1 1 2
nTDSSiteSettings 1 1 2
physicalLocation 1 1 2
queryPolicy 1 1 2
rRASAdministrationDictionary 1 1 2
server 2 2 4
serversContainer 1 1 2
site 1 1 2
siteLink 1 1 2
sitesContainer 1 1 2
subnetContainer 1 1 2
---
1489 1489 2978
..............
Bytes per object:
configuration 828
container 18992
controlAccessRight 23564
crossRef 1952
crossRefContainer 322
dSUISettings 8400
displaySpecifier 469344
foreignSecurityPrincipal 6056
interSiteTransport 596
interSiteTransportContainer 408
licensingSiteSettings 436
lostAndFound 334
mSMQEnterpriseSettings 350
msPKI-Enterprise-Oid 304
nTDSConnection 1628
nTDSDSA 660
nTDSService 324
nTDSSiteSettings 396
physicalLocation 420
queryPolicy 336
rRASAdministrationDictionary 398
server 594
serverContainer 304
site 258
siteLink 312
sitesContainer 288
subnetContainer 300
..............
Bytes per server:
netdc1.net.dom 269052
netdc2.subdom.net.dom 269052
..............
Checking for missing replies...
No missing replies! INFO: Server sizes are equal.
*** Identical Directory Information Trees ***
PASS -=>>PASS <<=-
closing connections...
netdc1.net.dom; netdc2.subdom.net.dom;
As you can see, the number of objects of each type is displayed, along with the total
size of objects of a specific type.
Basically, there are three types of inconsistencies between directory replicas which
DsaStat can detect. Let us consider these types in the examples given below. In
each case, we will compare the results of statistical and full-content comparisons of
an OU object's replicas. For compactness, only the most interesting lines from the
DsaStat's screen output will be shown.
If the values of one or more attributes of the same object are different on specified
domain controllers, statistical comparison (similar to the one shown above) only
counts total sizes and produces the following result:
You can only conclude from such an output that the replicas differ, and nothing more.
The following command performs the full-content comparison as well as detects both
a changed, albeit non-replicated directory object (a GPO) and an attribute name
(versionNumber) (notice that the −t:FALSE parameter is used):
Thus, you can see both the number of errors and their location. The sizes of
compared trees on the specified servers can be equal as well as not equal. This
depends on the changes made with the directory objects.
If the replicas of the same object have different numbers of attributes, the statistical
comparison, again, reports only that the replicas' sizes are not equal. Let us look at
the results produced by a full-content comparison.
As you can see, the tool displays the number of attributes for each object replica,
shows the DN of the object, and then lists the attributes for each replica. The missing
attribute can be easily found.
In the following example, a user mark and a computer Comp 1 have been deleted
from the Staff OU on one domain controller, and the changes have not yet been
replicated to another DC. In this case, both statistical and full-content comparisons
report that the test has failed, and that there has been a "Server total object count
mismatch". A full-content test, however, displays specific information about the error:
the type and name of the missing object. Look at the following sample output:
computer 1 2 3
group 2 2 4
organizationalUnit 1 1 2
user 4 5 9
volume 1 1 2
---
9 11 20
FAIL Server total object count mismatch
...
Checking for missing replies...
Fail [2]: missing 1 replies for
'<GUID=65d29dba5ad79e4e947c4a85bdb2c774>;<SID=010500000000000515000000dc
f4dc3ba837d66516
c0ea3264040000>;CN=Comp1,OU=Staff,DC=net,DC=dom'
Fail [3] : missing 1 replies for
'<GUID=f8c1c9cf1e919a469821b7ceb67608e2>;<SID=010500000000000515000000dc
f4dc3ba837d66516
c0ea3266040000<;CN=Mark,OU=Staff,DC=net,DC=dom'
INFO: Server sizes are not equal (min=1838, max=2227).
*** Different Directory Information Trees. 3 errors (see above). ***
FAIL -=>> FAIL <<=-
closing connections...
netdc1.net.dom; netdc4.net.dom;
Replication Diagnostics Tool is the only facility that allows an administrator to view
and manage Active Directory replication topology and events from the command
prompt or batch files. This tool, coupled with DsaStat.exe, helps to troubleshoot
Active Directory consistency problems at a forest-wide level.
The Windows .NET version of RepAdmin provides about a dozen new operations (in
contrast with Windows 2000 version) as well as a few new parameters to previously
available operations (some of which are discussed below).
We will consider some of the most frequently used options of this tool. Some of these
options may seem to be too complicated. However, if you understand the Active
Directory replication model well, you will quickly learn how to use the tool in the most
effective way.
Triggering KCC
The first and one of the most important steps for managing replication is to
enumerate partners (neighbors) that have connections to the specified DC and to
determine the replication topology for each naming context. (This information is used
with many other of RepAdmin's parameters.) The following example was obtained for
a forest that consists of two domains and two sites. The root domain net.dom is
located in the NET-Site and contains two DCs (NETDC1 and NETDC3A). The child
domain subdom.net.dom is located in the Remote-Site and has a single DC (NETDC2).
Let's see what kind of information RepAdmin displays for the specified DC. (In-line
comments are in bold brackets.)
====INBOUND NEIGHBORS===================
To see outbound partners, add the /repsto parameter (or/all) to the previous
command. RepAdmin will append the following lines to the output:
CN=Configuration,DC=net,DC=dom
NET-Site\NETDC3A via RPC
DC object GUID: a10bc624-6d04-44e7-adf9-5ef4282efbb1
CN=Schema,CN=Configuration,DC=net,DC=dom
NET-Site\NETDC3A via RPC
DC object GUID: a10bc624-6d04-44e7-adf9-5ef4282efbb1
DC=App-Part,DC=net,DC=dom
NET-Site\NETDC3A via RPC
DC object GUID: a10bc624-6d04-44e7-adf9-5ef4282efbb1
Note In fact, the NETDC1 and NETDC2 domain controllers are connected by the IP
transport (since these DCs are related to the different sites). However, both IP
and RPC transports are displayed as "via RPC". The /showconn operation (see
below) displays more detailed information.
To obtain more details, add the /verbose parameter to a command. Verbose mode
displays additional information; for example:
...
CN=Schema,CN=Configuration,DC=net,DC=dom
Remote-Site\NETDC2 via RPC
DC object GUID: 8c19c6f6-1821-4ca7-97b5-c23307c5c49c
Address: 8c19c6f6-1821-4ca7-97b5-c23307c5c49c._msdcs.net.dom
DC invocationID: a2043786-1d80-4ea7-b759-c5884ad6085f
DO_SCHEDULED_SYNCS WRITEABLE COMPRESS_CHANGES
NO_CHANGE_NOTIFICATIONS
USNs: 148919/OU, 148919/PU
Last attempt @ 2002-06-02 16:58:51 was successful.
NET-Site\NETDC3A via RPC
DC object GUID: a10bc624-6d04-44e7-adf9-5ef4282efbb1
Address: a10bc624-6d04-44e7-adf9-5ef4282efbb1._msdcs.net.dom
DC invocationID: 15eaa260-364d-469c-b2aa-1fe3c74059df
SYNC_ON_STARTUP DO_SCHEDULED_SYNCS WRITEABLE
USNs: 79723 /OU, 79723 /PU
Last attempt @ 2002-06-02 18:57:37 was successful.
...
Look at the highlighted flags from this output. You can conclude the following from
them:
Both inter- and intra-site replications are scheduled (but these are different
schedules!)
Inter-site replication is compressed.
There is no change notification between DCs related to different sites (this is
the default option).
DCs in the same site are synchronized upon their startup.
The DNS name of the DC that will serve as the source of information
The GUID (or the NetBIOS name) of the DC you are interested in
(Without the second parameter, you will get all connections for the site where the
specified DC is located.) For example, the NETDC1 domain controller from the
sample configuration has two inbound connections:
Notice that two different transport types — one for intra-site (intrasite RPC) and one for
inter-site replication (IP) — are displayed.
The command shown will display all fault connections (that have not been replicated
over a period of time) and the possible cause of failure.
By using RepAdmin, you can initiate replication events very flexibly. For a domain
controller, the following replication scenarios are available:
A directory context (in Windows .NET, you can also specify a single directory
object; see below)
The DNS name of the target (destination) server
The GUID of the source server (from which the changes are copied)
For example, to replicate the domain partition between two DCs, use a command
similar to:
You must wait until the operation is completed, or you can start the operation
asynchronically and check the replication queue to see whether the operation has
completed. To trigger a full replication of a directory context, you can, for example,
use the following command:
C:\>repadmin /queue
Sometimes, a command fails. Take a look, for example, at the following output
produced by a command:
(To see a name which corresponds to the GUID shown, use repadmin /showreps.)
In Windows 2000, only an error code is displayed. You can get a text description of a
message by running RepAdmin with the /showmsg parameter and specifying the error
code.
Use the repadmin /syncall /h command to see help information for additional
parameters (flags), some of which are especially important:
/A — replicates all naming contexts stored on the DC. (A new option in the
Windows .NET version of RepAdmin.) For example, the following command
synchronizes all partitions on NETDC1 DC with all their replicas:
repadmin /syncall netdc1.net.dom /A
/d — changes representation of DCs in output messages, for example, instead
of:
a10bc624-6d04-44e7-adf9-5ef4282efbb1._msdcs.net.dom
CN=NTDS Settings,CN=NETDC3A,CN=Servers,CN=NET-Site,CN=Sites,
CN=Configuration,DC=net,DC=dom
/e — enables cross-site replication. You can see the difference if, for example,
you try to synchronize the Configuration partition by using a command with
this parameter, and then without it.
/P — reverses the direction of replication. When this parameter is used, the
changes are propagated from the specified server to all partners (vice versa
by default).
Failed Replications
RepAdmin has a few options that can be used for monitoring the actual state of
domain controllers. You can easily determine whether changes have been made on
a DC, and whether directory partitions have been synchronized on different DCs.
Then we must check the value known to the second DC. We should specify: the
invocationID of the first DC (see description of the /showreps operation above), the
USN found, and the DNS name of either DC:
As you can see, the second DC holds an older USN. If we run the command again
after replicating changes from NETDC1 to NETDC4, the result should be the
following:
By viewing replication metadata for a directory object, you can check the consistency
between different replicas if you compare attribute versions and USN numbers on
different domain controllers. Furthermore, you can see which DC (it is considered to
be the originating DC) the attributes were last changed on. The following example
shows metadata for an OU object. (The output has been compressed horizontally to
fit the page.)
C:\>repadmin /showmeta OU=Staff,DC=net,DC=dom netdc1.net.dom
13 entries.
Loc.USN Originating DC Org.USN Org.Time/Date Ver Attribute
======= ============== ======= ============= =============
11826 NET-Site\NETDC1 11826 2002-06-07 17:24:38 1 gPOptions
11826 NET-Site\NETDC1 11826 2002-06-07 17:24:38 1 gPLink
11767 NET-Site\NETDC1 11767 2002-06-07 17:09:11 1 objectCategory
11893 NET-Site\NETDC1 11893 2002-06-07 17:33:59 4 name
11907 NET-Site\NETDC1 11907 2002-06-07 17:34:49 3 nTSecurityDescriptor
11767 NET-Site\NETDC1 11767 2002-06-07 17:09:11 1 whenCreated
11767 NET-Site\NETDC1 11767 2002-06-07 17:09:11 1 instanceType
11817 NET-Site\NETDC4 18306 2002-06-07 17:24:17 2 description
11893 NET-Site\NETDC1 11893 2002-06-07 17:33:59 4 ou
11923 NET-Site\NETDC4 18389 2002-06-07 17:40:59 2 street
11923 NET-Site\NETDC4 18389 2002-06-07 17:40:59 2 st
11923 NET-Site\NETDC4 18389 2002-06-07 17:40:59 2 1
11767 NET-Site\NETDC1 11767 2002-06-07 17:09:11 1 objectClass
It is possible to register all of the changes that have been made on a domain
controller from a specific time point. The following command analyzes the current
state of the domain partition and writes the result to a file:
The command produces a very large screen output; therefore, you might prefer to
add the /statistics parameter to this command.
As you can see, two objects have been modified, and one object has been deleted.
The time stamp is renewed, and only new changes will be registered from that
moment.
Notice that the command contains the domain partition name, the DNS name of a
replication partner (in that case, this is a "reference" DC), and the GUID of a tested
domain controller (netdc1.net.dom). This command displays changes made on
NETDC1 before the replication will be performed and two directory replicas will be
synchronized. In comparison to the previous command (with a cookie file), the last
command will display the same result (the changes made) repeatedly unless the
synchronization of replicas will be carried out. You can choose either command that
is the most appropriate for your conditions.
A command that compares the partition replicas stored on different servers must
contain the DNS name of a "reference" server and the GUID of a "source" (tested)
server. All changes made in the source server will be registered. Actually, this
command performs the same job as the DsaStat tool does. The output shown below
was obtained at the time when a great number of user objects on the NETDC1
domain controller were being removed.
Source Neighbor:
DC=net, DC=dom
NET-Site\NETDC1 via RPC
DC object GUID: b202a2a9-2e6b-4c9f-9e99-ac00b873e5c2
Address: b202a2a9-2e6b-4c9f-9e99-ac00b873e5c2._msdcs.net.dom
DC invocationID: b202a2a9-2e6b-4c9f-9e99-ac00b873e5c2
SYNC_ON_STARTUP DO_SCHEDULED_SYNCS WRITEABLE
USNs: 12769 /OU, 12769 /PU
Last attempt @ 2002-06-07 19:11:29 was successful.
No changes
The Windows .NET version of RepAdmin offers a number of new operations that are
especially useful in large multi-site forests. Among them are the following:
Auxiliary Options
The following command detects that the specified domain controller is a Global
Catalog server:
The options attribute is equal to 1 in this case. You can set the IS_GC flag to promote
a DC to GC server. Usually, this operation is performed with the Active Directory
Sites and Services snap-in.
The following two parameters allow you to "isolate" a DC from its replication partners
for troubleshooting or some other purpose. The next example shows that replication
from the specified DC (outbound replication) is disabled:
The options attribute is equal to 4 (hex) in this case (if the DC is not a GC server!).
To set a flag, specify it with a "+" (plus) sign. To clear a flag, use "-" (minus). For
example, the following command clears the flag and re-enables outbound replication
from the DC:
C:\>repadmin /options netdc4.net.dom -DISABLE_OUTBOUND_REPL
Current DC Options: DISABLE_OUTBOUND_REPL
New DC Options: (none)
Every "disable replication" operation is registered in the Directory Service log (Event
ID 1113, 1114, 1115, and 1116). Look at the following two examples:
RepAdmin can convert time values stored in Active Directory into a readable format.
(See also NLtest description at the beginning of this chapter.) Let us convert the
same value 126679218485309520. Enter repadmin /showtime at the command prompt,
and paste the value in. Erase the seven rightmost digits and press <Enter>. The
result should be the following:
You may notice that both UTC and local time are displayed.
In Windows .NET, you can obtain the same result easier — use the W32tm
command:
RepAdmin.exe has an option that will help you when you write and debug ADSI
scripts and application and analyze event logs, as well as in many other cases. You
can use this utility rather than searching the documentation for information on each
error. The utility provides many more options than the net helpmsg command does.
RepAdmin.exe can display error text for both Win32 error codes (including errors for
ADSI 2.5) and generic COM error codes.
You can specify an error code in either form: as a long integer (e.g., -2147016684) or
a hexadecimal value (e.g., 0x80072014; the 0x prefix is mandatory, do not forget to add
this prefix if you have copied an error's code from the Event Viewer). Short integers,
such as 8453, are also acceptable. Here is an example of how to use this parameter:
Active Directory Replication Monitor is a GUI tool that is exclusively intended for
monitoring and managing all kinds of replication in AD-based domains (Windows
2000 and Windows .NET domains). With this tool, you can monitor and register all
replication events, force replication, start generating replication topology, view Global
Catalog and bridgehead servers, and view trusts and replication metadata for an
Active Directory object. The list of options could be continued. The tool has a simple
and friendly user interface.
After the tool's start-up, you should create a list of monitored servers. This might be a
tiresome operation in a large domain, but you only need to perform it once. When all
necessary servers have been added to ReplMon, save the current configuration by
clicking Save Monitored List As in the File menu. The next time the tool is running,
choose the Open Script command and load the necessary configuration. A sample
screen of the ReplMon's main window is shown in Fig. 11.3.
Figure 11.3: The main window of ReplMon, where you can browse the domain tree
and see log files for selected domain partition and replication partner
ReplMon uses various icons to represent monitored servers and their replication
partners, which helps an administrator to easily determine replication status. The
icons are described in the table below.
Icon Description
Let us consider what replication topology information we can obtain from the
screenshot shown in Fig. 11.3:
The sample forest comprises two domains, two sites, and three domain
controllers.
Each site has a Global Catalog server: NETDC1 DC receives a partial replica
of the subdom.net.dom domain, whereas NETDC2 DC receives partial
information about the DC=net,DC=dom naming context. In addition, both
controllers are the bridgehead servers.
NETDC1 DC stores three application directory partitions:
DC=DomainDnsZones, DC=net,DC=dom, DC=ForestDnsZones,
DC=net,DC=dom, and DC=App-Part, DC=net, DC=dom. Only the last partition
has a replica on NETDC3A DC.
NETDC2 DC stores the domain partition (DC=subdom,DC=net,DC=dom) that
is not replicating to any other domain controllers.
Replication events for the selected pair of partners (NETDC1 and NETDC3A)
and directory context (DC=net,DC=dom) are written into a file named
netdc1.net.dom-DC=net,DC=dom-NETDC3A.log.
NETDC1 DC fails to replicate three directory contexts (domain, schema, and
configuration) from NETDC3A DC. The log selected contains the reason of
failure: "The RPC server is unavailable".
NETDC3A DC has a general problem with replication of the DC=net,DC=dom
naming context and fails to replicate data from NETDC1 DC.
Log Files
By default, ReplMon writes all Replication Status Logs to the My Documents folder
of the currently logged on user. The log name combines the domain controller's DNS
name, directory partition name and a replication partner down-level name.
You can assign a different location if you like. Click Options in the View menu, check
the Default Path for Replication Status Logs box, and enter the necessary path.
(To troubleshoot replication problems, you can also enable debug logging, allowing
ReplMon to register every performed operation.)
ReplMon updates the Replication Status Logs at its start-up, and you can specify a
time interval for automatic updating. If you do so, all replication activity for monitored
servers will be registered in the logs.
Managing Replication
By using ReplMon, you can initiate any replication events possible for the selected
domain controller. Most operations are started through the context menu of the
selected DC. These operations are quite simple to learn, and all the tool's features
are visible in the menu.
ReplMon has a very useful feature that allows you to view performance data usually
available through the Performance snap-in. (See the "Monitoring Replication"
section in Chapter 6, "Configuring and Troubleshooting AD-based Domains".) First,
open the Performance snap-in and choose the counters you are interested in and
write down their names. (You do not need the Performance snap-in itself!) To
simplify a task, you can add the necessary counters to the Performance snap-in's
window, click the Copy Properties button on the tool bar, and paste the text into a
document. This text will contain all counter names (see the Path parameter) in
addition to other information. Then start ReplMon, click Options on the View menu,
and select the Status Logging tab (Fig. 11.4).
Figure 11.4: Configuring counters that will comprise current performance data
Check the Performance Statistics box, click Add, and enter a counter name (e.g.,
"\NTDS\DRA Inbound Bytes Compressed (Between Sites, After Compression) Since
Boot"). Repeat this step if necessary. If you have already saved the counter names
from the Performance snap-in into a text document, you can now easily copy-and-
paste all names. Now you can select a DC and choose the Show Current
Performance Data command from the context menu. You will see all current values
of counters in the Performance Data window. The current data will be also written to
the domain controller's logs.
Also, take note of the Group Policy Objects and Display Changed Attributes
when Replication Occurs checkboxes on the Status Logging tab. The former
checkbox will allow you to verify consistency of GPOs (AD and SysVol versions) with
the Show Group Policy Object Status command. The latter checkbox turns on the
logging of changed attributes: you will see their names as well as the names of
corresponding directory objects in the logs. This will allow you to trace all changes in
the directory more precisely.
Since Active Directory may contain a huge number of directory objects and have a
complex domain structure, it is necessary to have the ability to locate, or pick out the
necessary objects quickly and view (edit) their attributes. You can use for that
purpose the following facilities.
GUI Tools
Command-line Tools
DsQuery.exe and DsGet.exe — the standard Windows .NET tools (they do not
work on Windows 2000 systems!) that use the LDAP protocol (therefore, they
can query both Windows 2000- and Windows .NET-based domains) and can
find directory objects of various types as well as display their attributes.
Search operations can be performed within a single domain or entire forest.
Search.vbs — a script from the Support Tools pack. Can search within a
single domain and work with the LDAP provider only.
Windows Domain Manager (NetDom.exe) (Support Tools) — can display
specific information about domains (FSMO role owners, trusts, etc.) as well as
perform modifications.
The Search.vbs script is a simple, handy tool that allows you to retrieve the attributes
of the specified objects. By default, the script displays the Ads Paths of the children
of the object specified by its distinguished name. These children objects may be of
any type.
Administrators or any other users may use the script on any Windows platform,
provided that the Windows Scripting Host (WSH) is installed. This is a unique
instrument, since the other search tools require Windows 2000/XP/.NET.
Caution The Search.vbs script does not display certain object attributes, such as
objectGUID, objectSID, lastLogon (these are attributes of "complex" types,
such as OctetString, Largelnteger, etc.), and some others. What is worse,
the script has an internal bug, which sometimes produces an erroneous
output when such attributes are included in the returned parameters list (for
instance, search for a user's objectSID, lastLogon, and cn attributes).
Analyzing the listing of the script will help you to better understand the
methods of retrieving data of various types (see also Chapter 16, "Active
Directory Service Interfaces (ADSI)") while composing your own scripts.
The script outputs the data found as a sequence of lines in the following format:
If the script cannot display a property value, it outputs only the first two components,
e.g., objectSID 1. If a property has an empty value or is not defined, the "=" character is
added, e.g., description 1 =.
Suppose you want to verify whether a known GUID really belongs to a directory
object, or you want to check the name of this object. You may use the following
command:
C:\>search
"LDAP://<GUID=075f1790071a854d82ee5556c3a11d64>"/S:base
<LDAP://<GUID=075f1790071a854d82ee5556c3a11d64>>;
(ObjectCategory=*); ADsPath; base Finished the query. Found 1
objects. ADsPath
1 = LDAP://OU=Staff, DC=net, DC=dom
You may also widen the scope of the search (i.e., use the /s:oneLevel or /S:subTree
parameter and get the base object's children names), or specify output of additional
attributes.
Note If the object's name is all you want to know, you may also use the Guid2obj.exe
utility from the Windows 2000 Resource Kit. You should provide the object
GUID as a parameter, and the tool will retrieve the distinguished name of the
object from the nearest global catalog server.
dsquery * -filter
objectClass=GroupPolicyContainer -attr cn
displayName
There are three basic "standard" tools that can be used for browsing Active Directory
and editing the properties of directory objects.
ADSI Edit snap-in — from the Support Tools or Windows Administration Tools
packs. This snap-in was discussed in Chapter 7, "Domain Manipulation Tools".
It does not display all directory objects and attributes, but has a simple user
interface and a flexible mechanism of custom query views. It provides you with
access to all Active Directory partitions (including application partitions) as well
as Global Catalog and offers a standard way of working with permissions on
objects. Works with the LDAP protocol only.
Active Directory Browser (AdsVw.exe) — from the Active Directory Service
Interfaces Software Development Kit (ADSI SDK). The only tool that is able to
work with both the LDAP and WinNT protocols. It therefore allows you to work
with AD- and Windows NT-based domains simultaneously. It is not well-
documented and requires a solid understanding of Active Directory. Works
with security descriptors.
Active Directory Administration Tool (Ldp.exe) — from the Support Tools. The
most sophisticated tool for manipulating directory objects with the LDAP
protocol. It requires extensive knowledge of LDAP basics (naming, queries,
etc.) as well as Active Directory architecture. Works with security descriptors
and Active Directory replication metadata.
These utilities can be regarded as "mandatory" tools set for troubleshooting various
directory problems, and especially for composing your own administrative scripts or
designing Active Directory-oriented applications.
Note Unfortunately, among the above-mentioned tools, only the ADSI Edit snap-in
works with non-Latin Unicode names of objects without any problems. The
limitations of the other two tools are discussed in the appropriate sections.
If you need to work with objects' GUIDs (the objectGUID attribute), use Ldp.exe
or DsQuery.exe, since the other two tools (AdsVw.exe and ADSI Edit) display a
GUID as a binary value (octet string), which cannot be used for binding,
referring, etc.
Active Directory Browser (AdsVw.exe) (ADSI SDK)
The Active Directory Browser is included in the ADSI SDK (also known as Active
Directory SDK) that you can download from the Microsoft website (see links in
Appendix A).
The main peculiarity of the Active Directory Browser is its ability to work with both
Windows NT 4.0 and AD-based (Windows 2000 and Windows .NET) domains (see
Figs. 12.1 and 12.2). Moreover, this is the only browsing tool that has multiple-
document interface (MDI), which allows you to open separate windows for different
objects or queries, organize them in the main window, and, therefore, simultaneously
work with many directory objects, either in the same domain or in a few domains.
Fig. 12.1: Browsing the flat directory object namespace of a Windows NT 4.0 domain
Unfortunately, this tool is not documented. That is why we will consider some basic
features in detail, since many of the tool's options are not obvious.
To open a new browsing window, press the <Ctrl>+<N> keys, select ObjectViewer
in the opened window, and fill in the Enter ADs path field (Fig. 12.3). (Remember
that you can include the name of a specific server in the directory path.)
To use credentials different from those of the last connected user, check the Use
OpenObject and Secure Authentication boxes, and fill in the Open As and
Password fields.
Some attributes, such as primaryGroupToken, can be viewed only if you have
checked the Use Extended Syntax box.
Note The mandatory attributes of an object are shown first in the Properties list (see
Figs. 12.1 and 12.2) and are followed by the optional attributes in alphabetical
order.
The results of a sample query are shown in Fig. 12.5. To start a query, press the
<Ctrl>+<N+ keys, select Query in the opened window, and fill in all fields in the Edit
Query window (Fig. 12.4). All attribute names must be explicitly specified. Click OK.
You may leave all fields in the next window (Set Search Preferences) empty. (You
will understand the meaning of the parameters presented in this window better if you
read the section about the Ldp.exe tool later in this chapter, and about searching
Active Directory in Chapter 16, "Active Directory Service Interfaces (ADSI).")
Fig. 12.4: Preparing a sample query: finding all OUs in the domain
Note You may use the privileges of the currently logged user when browsing
directory objects (using either protocol), but you must always provide valid
credentials while creating a new query. Otherwise the query will be
unauthenticated (and therefore very restricted), and the result set will most
probably be empty.
The window with the result set for the sample query is shown in Fig. 12.5.
If the result set does not fit the window, you must scroll down all lines (using the
down arrow button) to see the entire set for the first time.
Active Directory Administration Tool (Ldp.exe) is a GUI tool, which allows you to
query, browse, and modify LDAP-compliant directories (servers) via the LDAP
protocol. The tool allows an administrator to access information that cannot be
derived with the help of other tools, as well as to compose sophisticated and powerful
queries with various scopes.
Note The Windows .NET version of Ldp.exe works properly within both Windows
2000- and Windows .NET-based domains, but cannot run on Windows 2000
systems. The Windows 2000 version of Ldp.exe fails to display Unicode names
in non-Latin coding and the contents of directory containers with similar names.
Both in tree-browsing mode and when search operations are performed,
Ldp.exe always displays all non-Latin Unicode values of attributes in string
format in the form of <ldp: Binary blob>.
To work with an LDAP server, the user must perform two primary operations —
connecting and binding. (Connectionless operations and operations without binding
(authenticating) are extremely restricted.) The information necessary for both
operations is shown in Fig. 12.6.
The Server field in the Connect window can contain a server's DNS name or IP
address as well as a domain DNS name. By default, port 389 is used for the LDAP
protocol, and port 3268 is designated for Global Catalog. If you leave the Server field
blank when working on an AD-based domain client computer, a connection is made
to your logon DC (LOGONSERVER). (To work with Ldp.exe in an AD-based
environment, you must be logged onto a forest.) If the User and Password fields in
the Bind window are left blank, the credentials of the user who is currently logged on
are used.
If the connection is successful, the information about the RootDSE object — base
DSA information — is displayed. After binding, you can make queries and/or browse
the object tree (click Tree in the View menu) (Fig. 12.7).
General Options
The tool's basic options are defined in the General Options window. To open it, click
General in the Options menu (Fig. 12.8).
Value Parsing
In some specific cases, you may want the values of found attributes to be displayed
in binary format. Select the Binary switch and, instead of the default string
representation of an attribute, you will get its "low-level" value. For instance, the
string format may look like:
1>
whenCreated: 3/15/2002 8:38:45 Central Standard Time
Central Daylight Time;
1>
whenCreated: 32 30 30 32 30 33 31 35 31 34 33 38 34 35
2e 30 20020315143845.0
5a Z
LDAP Version
You can select the version of LDAP protocol only before the connection is made.
After this, both switches in the LDAP Version group are grayed.
Checking this box enables the display of the RootDSE information when connecting
to a LDAP server. Besides, if this box is checked, the current domain context name is
automatically used as the base DN when the tree view is selected. Otherwise, you
must always specify a DN of a container.
Virtual List View is a new feature of Windows .NET systems that support a pair of
appropriate LDAP controls (namely, 2.16.840.1.113730.3.4.9 and
2.16.840.1.113730.3.4.10). The feature is designed for retrieving information from
queries that produce very large result sets. The user can only obtain a predefined
number of sorted rows produced by a query rather than the entire result set that can
count thousands of rows. Depending on the data received, the user can re-define the
query and repeat the search until the necessary information will be obtained. In the
Ldp tool, this feature is realized as a special window that can be opened either
automatically (if you check the Auto VLV browse when box) or manually (if you
select the Virtual List View command in the Browse menu). In the former case, the
Virtual List View window opens when you try to view (in tree mode) contents of a
directory object that comprises more child objects than is specified (by default, 100).
The methods of working with this window do not depend on how it is opened. An
example of the window is shown in Fig. 12.9.
The Virtual List View window resembles the Search window except for the data
pane that displays specified attributes of found objects in a tabular form. The new
portions of data will be requested as you scroll down the table rows. The Type Name
or Select from List field allows you to enter an object name, which the requested
server will try to find within the defined query. A few rows before that object and a few
rows after that object will only be sent to the client and displayed in the table. To see
the children of a found object, click twice on the corresponding row. You can right
click on an object and select for it a standard LDAP operation in the context menu
(see Fig. 12.9).
DN Processing
In the DN Processing group you can indicate how the tool will display the
distinguished names of the objects found. All options are listed below with sample
strings.
None (default)
>> Dn:
CN=Administrator, OU=ADMINs,
DC=net, DC=dom >> Dn: CN=Certificate
Templates, CN=Public Key Services,
CN=Services, CN=Configuration, DC=net,
DC=dom
Explode
>> Dn: CN=Administrator;
OU=ADMINs; DC=net; DC=dom; >> Dn:
CN=Certificate Templates; CN=Public
Key Services; CN=Services;
CN=Configuration; DC=net; DC=dom;
No type
>> Dn: Administrator; ADMINs; net;
dom; >> Dn: Certificate
Templates; Public Key Services;
Services; Configration; net; dom;
Ufn
>> Dn: CN=Administrator,
OU=ADMINs, DC=net, DC=dom >> Dn:
CN=CertificateTemplates,
CN=PublicKeyServices, CN=Services, CN=Configuration,
DC=net, DC=dom
Buffer Size
The Number of lines parameter sets the number of rows displayed in the result pane
before wrapping begins. Do not forget that you cannot obtain more rows in a query
than the MaxPageSize value in the query policy permits.
The Chars per line parameter sets the maximum number of characters displayed in
a line. Lines whose length exceeds this value are truncated!
In practice, referrals are very important in search operations, as they may greatly
influence the results. The Chase referrals box in the Search Options window (see
Fig. 12.12, left) determines whether or not the server generates LDAP referrals when
trying to find objects. (By default, the box is not checked, since this improves the
performance of the search.) However, in some cases, if this box is checked, an error
can occur:
Some other scenarios in which you may get an unexpected result are also possible.
Therefore, it is necessary to select the status of this checkbox carefully. Let us
discuss this issue using two examples.
Suppose you are logged onto a computer joined to a child domain, and want to
search the parent domain (or a domain from another domain tree) by entering its DN
as the base of the search. You must either make an LDAP connection to a DC in the
parent domain or enable chasing referrals. (Otherwise, the referral error will be
reported.) Why referrals should help in such a situation will become clear a bit later.
(Maybe you already understand what happens.)
Let us go to the second example. Suppose, for instance, you are searching your own
domain for referrals objects or DSA objects. The (objectClass=crossRef) or (cn=NTDS
Settings) filter strings, respectively, can be used for this purpose. The domain DN is
specified as the base of the search.
Without the Chase referrals box checked, you will get an empty result set. Maybe
you have forgotten, or did not initially know, that required objects are stored in the
Configuration namespace (directory partition). Furthermore, remember that the
search is performed in one namespace only unless you enable generating referrals.
The above-described search operation will be successful if you have done one of the
following: either directly specified the appropriate name context as the base of the
search or enabled generation of referrals.
(There are also other search options, but it is more difficult to configure them. You
can find additional information in the MSDN Library — look for "Extended Controls".)
Turning to the first example, it is clear now that if a server finds an object that refers
to another domain and cannot (is not allowed to) connect to the server that stores the
corresponding partition, it will generate a referral error message.
Sometimes, a requested server can return a number of rows that exceed the
MaxPageSize value. (Do not confuse the number of rows returned by a server on a
request and the number of rows that the tool can display in the result pane — the
Number of lines parameter.) The following error will be reported:
In such a case, it is necessary to use paging search results. You can request the
results in pages of a specific size. Open the Search Options window (see Fig. 12.12;
left) and select the Paged switch in the Search Call Type group. The Page size
value defines the length of the page. Now you will get the results of a search
operation in 16- row pages (by default):
You can continue searching by clicking Run, or you can terminate the operation at
any moment. When paging is used, you need not worry about how long the result of
a search is.
The Windows .NET version of Ldp.exe has a new option that allows you to obtain
additional information about some LDAP operation errors. Suppose you try to
connect to a DC and see the following messages:
1d =
ldap_open("netdc2.net.dom", 389); Error <0x51>: Fail to
connect to
netdc2.net.dom.
If you select the GetLastError command in the Browse menu, the tool will display the
message:
0x51=LdapGetLastError ()
Server Down
Sometimes this additional information can be valuable for understanding an error that
has occurred.
Saving Results
To clear the result pane before a new operation, click New on the Connection menu
or press <Ctrl>+<N+ keys. Any information displayed in this pane can be copied-
and-pasted.
At any moment, you may save the contents of the result pane by selecting Save or
Save As from the Connection menu. (You need not close the Search window.) The
latter option always asks you for a file name. The former option allows you to save
information in the current output file, and asks for a file name only after the tool starts
or a New command has been performed.
You may look up all domains and DCs in the forest in tree form. Click Enterprise
Configuration in the View menu. Click Refresh in the window that is open. After
some time, the actual configuration of your enterprise will be displayed in the window
(Fig. 12.10). You can get the configuration only after binding to a DC.
Fig. 12.10: In this window, you can see the entire domain structure (the forest) and
the state of all DCs
As Fig. 12.10 shows, two DCs (NETDC2, NETDC3) in the forest are online, and one
DC (NETDC1) is offline. Knowledge of the network's real state will help you to select
servers for connecting and making queries.
Searching Directory
For clarity and simplicity, we will discuss the procedure involved in finding objects in
Active Directory (or any other LDAP-compatible directory) using a few specific
scenarios.
Deleted Active Directory objects (so called tombstones) are stored in a hidden
Deleted Objects container for a pre-configured period of time, and then permanently
purged during garbage collection. This container cannot be accessed by using
standard snap-ins. The Show Deleted Object control (controlType =
1.2.840.113556.1.4.417) and search command allow you to retrieve the tombstones.
(You must have administrative privileges.)
3. Click Extended in the Search Call Type group, and enter the attributes of the
deleted objects that you wish to view (see Fig. 12.12, left). (You may also
need to increase the default Timeout (s) from zero to a bigger number. The
value can be determined by experimenting.) Click Controls.
Note If you receive the following error message, increase the timeout value:
Note You can combine a number of various controls in the same query.
To view and activate/deactivate the controls, you can open the Controls
window at any moment by clicking Controls in the Options menu.
As you know, the name (e.g., the cn attribute) of a directory object can be changed
by a rename object operation. If, for instance, an application uses the name for
referring to the object, it will "lose" this object after its renaming. A more appropriate
way would be to use the object GUID, which remains the same throughout the entire
lifetime of the object.
The question is thus how to find the object GUID. You might search the directory for
the object and specify the objectGUID attribute in the Search Options window.
However, it is possible to get the GUID of each object found in a search operation
immediately or to get it while browsing the directory tree. You need to activate the
Return Extended Distinguished Names LDAP control (controlType = =
1.2.840.113556.1.4.529).
Note It is also possible to get the GUID of an object by using the ADSI Edit snap-in.
However, that may be inconvenient, since the objectGUID attribute (as well as
objectSID) is in Octet-String format (e.g., "0x73 0xa5 0xe1 0xdd …" — 16 bytes
in all). You cannot directly substitute such a string in a search or bind
command. The Dsquery.exe utility would be a better choice.
The GUID search preparation steps are similar to those for deleted objects described
above. Let us find the GUIDs of the OUs that are contained in a domain. Enter the
following information:
Base DN — domain DN
Filter — (ou=*)
Subtree scope
Search Call Type —Extended
Attributes — ADsPath
Active Controls — 1.2.840.113556.1.4.529 (the Extended DN option in the
Load Predefined list)
Dn:
<GUID=079760441fb9d948afdeacab994997cb>;
OU=Domain Controllers, DC=net, DC=dom
The new component (marked here in bold) appears in the distinguished name. The
found GUID can be verified by using Search.vbs (see "Searching for an Object using
its GUID" at the beginning of this chapter), or you may use the entire string (between
and including the angle brackets) in a script in a bind operation.
For directory objects that represent security principals (user, group, and computer
accounts) output strings also contain object SIDs, for example:
Dn:
<GUID=a6ead32063e11a40924e57f9107a14ec>;
<SID=0105000000000005150000002fd5ec6ddde8e41c8aa7323feb030000>;
CN=NETDC1, OU=Domain Controllers, DC=net, DC=dom
You might notice that the result sets of search operations contain rows in a quite
random order. To obtain sorted results, you can use the Return Sorted Results LDAP
control (controlType = 1.2.840.113556.1.4.473). To obtain sorted results in any
search operations, perform the following steps:
1. Add the "1.2.840.113556.1.4.473" value to the Active Controls list (see Fig.
12.12; right).
2. Click Options | Sort Keys.
3. In the Sort Keys window (Fig. 12.13), enter OID of a sort key in the Attribute
Type field and click Check In and OK. You can obtain the attribute's OID
using the Active Directory Schema Manager snap-in. The name attribute
(1.2.840.113556.1.4.1) has been selected in our example.
4. Select all search parameters and click Extended in the Search Call Type
group in the Search Options window (see Fig. 12.12; left).
After all this, any search operations will produce sorted result sets unless the select
Sync in the Search Call Type group or delete the Return Sorted Results control from
the list of LDAP controls.
Updating Attributes
The LDAP update operations include the following: Add, Modify, Modify RDN, and
Delete. On the one hand (regarding the user interface), they are quite simple and
obvious; on the other hand, they require a rather keen understanding of Active
Directory architecture (particularly the schema, classes, and attributes). That is why
other tools, such as administrative snap-ins (ADSI Edit, Active Directory Users and
Computers, and so on), are more suitable for modifying Active Directory objects. In
an example below, we will discuss the most common steps involved in using Ldp.exe
for this purpose.
Note The Modify RDN operation is equivalent to renaming or moving an object. The
Cross Domain Move LDAP control (1.2.840.113556.1.4.521) enables you to
perform move operations over domain boundaries.
Modifying an Attribute
Let us change a user's UPN. First, click Modify in the Browse menu. In the opened
window, enter the user's DN, the attribute name, and its new value. Then select
Replace from the Operation group (because the attribute already exists), and click
Enter to add the data to the Entry List. No checks are performed at this time, so be
careful. You may correct the entered data by clicking Edit (and then editing the
information) or Remove. A sample window is shown in Fig. 12.14.
***Call
Modify... ldap_modify_s(ld, 'CN=John Smith, OU=Staff,
DC=net, DC=dom', [1]
attrs); Modified "CN=John Smith, OU=Staff, DC=net,
DC=dom".
If an error occurs while at some step of executing an operation, the tool reports an
error message, which is determined by the kind of error (such as a syntax error in the
entered data, or an error with the directory database, etc.). The message contains a
description of the error.
For example:
***Call
Modify... ldap_modify_s(ld, 'CN=John Smith, OU=Staff,
DC=net, DC=dom', [1]
attrs); Error: Modify: No Such Object. <32>
Deleting Objects
The delete operation is also fairly obvious and simple. However, a problem may arise
when you want to delete an object that has one or more child objects, for example,
an OU with user accounts. The following error may be reported:
To perform such an operation, you must use the Tree Delete LDAP control
(controlType = 1.2.840.113556.1.4.805). This control allows you to delete an entire
subtree, if you have sufficient permissions.
1. Add the Tree Delete control to the list of active controls (select the Subtree
Delete option in the Load Predefined list — see Fig. 12.12; right).
2. Click Delete in the Browse menu.
3. In the Delete window, enter the distinguished name of the container and check
the Extended box. (An example window is shown in Fig. 12.15.)
Fig. 12.15: Deleting a non-empty container (an OU in this case)
4. Click OK.
Ldp.exe allows you to view the security descriptor of any directory object. This
feature is intended for solving problems related to the accounts' permissions on
directory objects (e.g., when moving the security principals to another domain) and
can be especially useful when you are debugging scripts or applications that work
with security descriptors (see Chapter 17, "Scripting Administrative Tasks"). Using
this feature requires a sound understanding of the Active Directory security model
(access control lists (ACL) and access control elements (ACE), their inheritance,
etc.).
To view the security descriptor for a directory object, select the Security | Security
Descriptor command from the Browse menu and specify the distinguished name of
the object. If you want to see the directly specified or inherited audit settings (the
system ACLs) of this object, check the SACL box. A sample output produced by this
command is shown in Fig. 12.16. The command also displays the descriptor in the
SDDL (Security Descriptor Definition Language) string format (not shown in the
figure). As Fig. 12.16 shows, you can see all the information about the descriptor
(some of its elements are circled in the figure). That information includes, in
particular, control flags, the owner of the object, the number of ACEs, and elements
of each ACE, such as the ACE's type, the access mask, and the name and SID of
the security principal that was granted this right. You can retrieve all described
information from a descriptor by using a script (Chapter 17, "Scripting Administrative
Tasks", contains an example of such a script). You can also programmatically
manipulate the ACEs, i.e., grant or revoke permissions on directory objects.
Fig. 12.16: A fragment of a security descriptor shown by using Ldp.exe
Ldp.exe can display the directory object's metadata information (the replProperty-
MetaData attribute) that is used in replication. You can also view this information by
using the RepAdmin.exe command with the /showmeta parameter (see Chapter 11,
"Verifying Network and Distributed Services").
To view the metadata for an object, select the Replication | View Metadata
command from the Browse menu and enter the object's distinguished name. A
sample output is presented in Fig. 12.17.
Windows .NET-based domain controllers have a set of very useful and powerful
utilities that help administrators perform a number of operations with Active Directory
objects from the command prompt. In addition, these utilities can be used for batch
operations. For that purpose the results from a query command can be piped as input
to one of the other commands.
All these utilities (listed below) use the LDAP protocol and can query both Windows
2000 and Windows .NET domains. However, they can run on Windows XP/.NET-
based computers only.
There are a huge number of parameters of every utility, and you can view their
description in the Help and Support Center or in the built-in help feature. Do not
forget to use quotation marks around a parameter's string value.
The DsQuery.exe utility can find directory objects of any type or objects of a specific
type. The DsGet.exe utility displays the specified attributes (a limited set of attributes)
of specific type objects. These specific types are:
For example, the following command displays ADsPaths and GUIDs of the user
accounts in the User container:
The most universal dsquery * command can find objects of any type and display any
attributes of these objects.
C:\>dsquery user
The following two commands display the first and last names of all users in the
domain:
The base and scope of search operations can be specified as domainroot (default
option), forestroot
Renaming of an object:
The DsRm.exe utility deletes one or more directory objects. You can also delete an
entire object subtree.
The following command immediately (without any prompt) removes all child objects in
the Staff OU, but keeps (do not delete) the OU object itself:
Export Active Directory information to a text file (in LDIF or CSV format) that
can be easily viewed or/and edited. The retrieved information can be used for:
Composing documentation on directory objects
Performing bulk editing operations that cannot be carried out using the
standard administrative snap-ins
Creating templates for new users (if the standard option of copying user
accounts is not convenient for you)
Migrating directory objects between domains into the same or another
domain forest
Backing up the existing domain configuration (for safety or for re-
installation of domain controllers)
Import Active Directory information from a file. This means creating new
objects or modifying the attributes of existing ones in batch mode. Besides the
already mentioned export operations that imply import — bulk editing,
migrating, backing up, and creating user templates — the import into Active
Directory can be carried out for:
Deploying a pre-configured domain configuration (by the way, import is
performed when a domain controller is promoted — the CSVDE utility is
used for creating the "default" Active Directory structure)
Deploying Active Directory-based applications (extending the schema is
also possible)
Note Normally, the standard Backup utility is used for backing up and
restoring Active Directory. However, in some cases, export/import may
be a preferable choice for preserving domain configuration.
You can select either of these utilities for your tasks so long as you keep in mind the
two main differences between LDIFDE and CSVDE for a user.
Data format — LDIFDE uses files that respond to the LDIF standard, whereas
CSVDE supports the CSV format (see the appropriate section on each tool).
Possible operations — CSVDE can only export and import (create) data;
LDIFDE also allows you to modify attributes and delete objects.
The book contains a few examples of how to use LDIFDE and CSVDE. These
examples can be tested with either utility, depending on your specific requirements.
All of the tasks listed can also be fulfilled (and often, more effectively!) with custom
ADSI scripts. Knowing the possibilities and restrictions of all the tools permits you to
save time and select the appropriate tool for a specific task.
Basic information on the LDIFDE and CSVDE utilities is contained in the Help and
Support Center (search for "LDIFDE CSVDE"). (The -u parameter is missing in the
Help!) You can also run the utilities without parameters and get help information.
Error Logs Both utilities create an error log file (csvde.err or ldif.err) and a log for
completed operations (csvde.log or ldif.log). By default, these files are
stored in the current folder, and the logs' location is configured.
Parameters
Table 12.1 lists some of the most frequently used parameters of both utilities –
LDIFDE and CSVDE.
Common parameters
−f Input or output filename. "−f con" can be used No
for output to the console. Required parameter
−s DC name The name of the DC the
user is currently logged on
to
−t Port number. The Global Catalog port (3268) 389 (LDAP)
can also be used
−u Use Unicode format ANSI format is used
Note Do not forget about the omitted parameters (which have default values), or you
may obtain an undesirable or unpredictable result. Compare, for example,
cases when you only want to export OU objects and when you need to export
an entire OU subtree (default).
Export operations are usually successful. (The worst-case scenario is when an export
file does not contain all the objects you expect it to contain.) You need only take into
consideration the following: when you specify a list of attributes (by using the −l
parameter) in the export command, LDIFDE and CSVDE do not include any
information about non-defined attributes in the output file. Therefore, you might need
to manually include the attributes' names (if you need them) in the import file and as-
sign the appropriate values.
Note It is not possible to export security descriptors (or group policies — for domains
and/or OUs). You must also be careful about built-in and default groups, such
as Domain Users.
In the exported file, you may see a list of members different from the one that
the Active Directory Users and Computers snap-in displays.
The (givenName=*) filter allows you to choose only accounts of newly created
users, with the exception of built-in accounts. Built-in users (administrator,
guest, etc.) do not have given names.
While exporting information from Global Catalog (using the 3268 port), do not
forget that GC contains a restricted set of attributes. For example, 40-50
attributes (a very modest value, since the minimum is about 30 attributes and
maximum is about two hundred) are exported for a user object by default.
When GC is used, only 20-30 attributes are exported.
The number and type of the objects exported depend on a combination of the search
base and the LDAP filter (described in detail in Chapter 1, "LDAP Basics"). You can
export either a single directory object or all Active Directory objects. The choice of the
appropriate search base and filter is not a challenge unless you do not use both or
you have forgotten about the default values. The following two commands might
seem equivalent since either can export a computer account (provided that the
computer's cn attribute has a unique value in the domain):
In fact, the first command can export a few objects, and the second exports strictly
one object. In both cases, the omitted −p parameter (the scope of the search) means
that the search will be conducted in the subtree. Since the computer object is a
container and can have child objects, the first command exports the entire "family".
The second command finds the specified computer in the domain and exports it
alone (since there is no computer with such a name in the domain).
After a little practice with search base and filters, you will learn how select only the
necessary objects from Active Directory in the most effective and precise way. (See
more examples of command string in this chapter.)
Errors are more frequent when import operations are performed. There are three
main sources of errors.
Read-only attributes, which only the system can change. A typical error
message: ‘Unwilling To Perform. The server side error is "Access to the
attribute is not permitted because the attribute is owned by the Security
Accounts Manager (SAM)."’ You cannot include such attributes as objectSID,
objectGUID, etc., in the import files and must always use the −m parameter
while exporting objects if a consequent import is planned. When the −m
parameter is specified, all of the SAM attributes are ignored (see also
"Working with User Objects" later in this chapter).
Missed mandatory attributes. Refer to Table 12.2 to see which attributes must
be defined in import files when new directory objects are created. The
objectSID attribute is shown in bold to remind you that, notwithstanding the
fact that it is a mandatory attribute, it must not be used in import.
Table 12.2: Some Important Object Classes and Their Mandatory Attributes
Object class (category) Mandatory attributes
When directory objects are copied (exported and imported) from one domain to
another, it is helpful to use the −c parameter.
Unicode Support
LDFIDE and CSVDE have some problems with support of Unicode (namely, with
non-Latin localized string values). You should take this into consideration if non-Latin
values are stored in your Active Directory. Test your installation before starting the
bulk import/export operations. Since such values aren't written in the output file in
plain text format, it is hard to edit them. Encoding restrictions of the utilities are listed
below.
LDIFDE
CSVDE
LDIFDE, a command-line utility that is installed by default on every DC, can be used
for adding, modifying, renaming, and deleting directory objects. This utility uses
LDAP Data Interchange Format (LDIF) — an Internet standard that defines a file
format to perform batch operations for LDAP-accessible directories. LDIFDE is also a
preferred tool for extending the Active Directory schema.
Examples of LDIF files are shown below. LDIFDE can be run on any Windows
2000/XP/.NET-based client, provided you have supplied appropriate domain
credentials.
Table 12.3 is a snippet of an export file and lists all attributes of an exported user
object in LDIF format. Notice attributes in bold face, which are not exported when the
−m parameter is specified, and should not be imported. Notice also that the
objectGUID and objectSID are exported as binary values (this is marked with a
double colon). A few additional remarks are placed at the end of the table. These are
not all of the possible attributes, only a typical minimal set. The names of some
attributes as they are presented in the Active Directory Users and Computers
snap-in's UI are specified in bold square brackets. The relative DN (RDN) is also
specified, although it is not presented in the UI and cannot be directly modified. The
mandatory attributes are show in italics.
dn:
CN=John Smith, OU=Staff, DC=net,
DC=dom changetype: add accountExpires:
Table 12.3: Influence of −m Parameter on the Resulting Attribute List
Exported attributes and their values
9223372036854775807
badPasswordTime: 0
badPwdCount: 0
[**]
cn: John Smith codePage: 0
countryCode: 0 displayName: John
Smith [Display
name] distinguishedName: CN=John
Smith, OU=Staff, DC=net, DC=dom
givenName: John [First name]
homeDirectory:
\\netdc1\UsersData\jsmith homeDrive:
W:
[**]
instanceType: 4
lastLogoff: 0 lastLogon: 0
logonCount: 0 memberOf:
CN=Account Operators, CN=Builtin,
DC=net, DC=dom memberOf: CN=Server Operators, CN=Builtin, DC=net,
DC=dom name: John Smith
[**]
objectCategory: CN=Person,
CN=Schema, CN=Configuration,
DC=net, DC=dom
[*]
objectClass:
organizationalPerson [*]objectClass:
person
[*]
objectClass: top
[*]
objectClass: user
objectGUID::
pME9k/0HNk+lz9/kJBpp3g==
[**]
objectSid::
[**]
these attributes are mandatory for a user object, but are not required for an import
operation since the system itself creates the corresponding values.
[*]
these attributes are required for importing (creating) objects. To create a new user,
Table 12.3: Influence of −m Parameter on the Resulting Attribute List
Exported attributes and their values
Here is a sample command string that allows you to export the specified attributes of
all users (except for built-in accounts) from your current domain:
ldifde -f
ExportedUSERs.ldf -r
"(&(objectCategory=Person) (objectClass=user)
(givenName=*))" -l
"cn, givenName, objectClass, sAMAccountName"
When working with container objects, you must always remember that the
combination of the search base and the LDAP filter defines the result of the
operation: either you export only container objects of the specified type, or you export
an entire container.
Compare, for example, the following two commands. The first command exports all
OU objects from the current domain (remember the default values for the omitted −l,
−d, and −p parameters):
The second command exports an entire subtree, i.e., all objects (of any type), from
the specified OU:
ldifde
-f ExportedOU.ldf -d "OU=Staff,
DC=net, DC=dom" -v
LDIFDE is the tool recommended by Microsoft for extending the schema (however,
using CSVDE is also possible). (The requirements of the schema extension are
described in Chapter 16, "Active Directory Service Interfaces (ADSI).") Remember
that you must generate the base OID for your own attributes and classes before
executing a similar command. The following is an example of an LDIF import file,
which creates a string attribute with stringAttribute LDAP display name:
dn:
CN=String Attribute, CN=Schema, CN=Configuration, DC=net,
DC=dom changetype: add attributeID: 1.2.840.113556.1.4. ... .1
attributeSyntax:
2.5.5.12 cn: String Attribute isSingleValued: TRUE objectCategory:
CN=Attribute-Schema, CN=Schema, CN=Configuration, DC=net,
DC=dom objectClass:
attributeSchema oMSyntax: 64
Only the LDIFDE utility can be used for batch modifying Active Directory objects from
a command file. (Remember also the DsMod.exe utility!) To change (or set) one or
more attribute values of an object (or a number of objects) use the following
procedure:
1. Export the necessary object(s) to a file. Use the appropriate filters. You may
export all attributes or specific ones only. This step is optional — you may
create the import file manually from scratch.
2. Edit the export file. Delete the entries for unnecessary (unchanged) attributes.
Change changetype from add to modify. Replace each attribute entry with the
following lines:
3. replace: <attributeName> <attributeName>:
<newValue>
If the second line is omitted, the attribute value will be cleared. The "−" (minus)
character must follow the lines for each attribute (including the last one). An
empty line must precede each attribute's distinguished name (excluding the
first one). Let us illustrate these requirements with an example. The sample
import file is used for modifying attributes of two user objects (the comments in
bold square brackets are not really included in the file!).
4. Import the edited file. The import is performed until the first error, but you can
safely repeat it as many times as you wish while correcting errors.
By modifying attribute values, you can also change membership in a group(s). To
add a user to a group, use lines similar to the following:
To delete a leaf object, it is sufficient to include the following two lines into the import
file:
You cannot delete a container if it has child objects. The LDAP protocol, actually,
allows you to delete a subtree (see the Ldp.exe tool description earlier in this
chapter), but LDIFDE does not permit one to perform such an operation.
CSVDE uses the Comma-Separated Value (CSV) file format (with a .csv extension).
Files in this format can easily be viewed (imported) or prepared (edited and exported)
by using various applications, including Microsoft Excel. The first line in such files
contains the names of attributes, separated by a comma. The next lines contain the
values of attributes, one line per object. An example of such a file is shown in the
next section.
Let us discuss the problem of Unicode support in an example with the CSVDE utility.
The following command exports the minimal set of OUs' attributes that allow you to
import the OU structure to another domain:
Note If all attributes are to be exported (no −l parameter used), add the −m parameter
to the command.
On the screen, the command produces an output (thanks to the verbose mode)
similar to the following:
Error writing
to file. This error happens when the entry cannot be written, it can be
caused
by writing a Unicode value to a non-unicode file. An error has occurred
in the
program
Here is the exported CSV-file produced by the command (the first line contains the
attributes' names):
DN,
objectClass, ou "OU=Domain Controllers, DC=net, DC=dom",
organizationalUnit,
Domain Controllers ... "OU=OU=∏epcoHaΠ, DC=net, DC=dom",
organizationalUnit,
X'd09fd0b5d180d18 1d0bed0bdd0b0d0bb'
Notice that the last line contains a coded value for the ou attribute.
Caution If you create an import file with non-Latin Unicode values from scratch, do
not forget to save it in Unicode format (not in ANSI) and use the -u parameter
when importing the file.
Add error on
line 2: Unwilling To Perform The server side error is "The modification
was not
permitted for security reasons." 0 entries modified successfully. An
error has
occurred in the program
The following error specifies that you want to import an attribute(s) that only the
system can change:
Add error on
line 3: Constraint Violation The server side error is "Access to the
attribute
is not permitted because the attribute is owned by the Security
Accounts
Manager (SAM)."
If you encounter such an error, use the −m parameter for export, and if the error still
exists, check the import file for consistency. Try to get rid of "unnecessary" attributes
when doing export. Let us look at a situation where you yourself produce a critical
error by using the −c parameter.
The scenario is the following. Suppose that you want to copy an entire OU from one
domain (net.dom) to another (subdom.net.dom) and rename the OU at the same
time. You use the −c OU=Personnel OU=Staff, DC=subdom parameter to change the
source DN OU=Personnel,DC=net,DC=dom to the destination DN
OU=Staff,DC=subdom,DC=net,DC=dom. The problem is that the ou attribute will not
be changed by such a replace operation, and will remain the same. As a result, an
inconsistency in the dn and ou attributes has occurred. You can only solve the
problem by omitting the ou attribute when exporting. The sIDHistory attribute
presented in the import file will also prevent you from successfully importing. The
following command meets all requirements and may perform the desired action:
csvde -f Subtree.csv -d
OU=Personnel,DC=net,DC=dom -c OU=Personnel
OU=Staff,DC=subdom -o ou, sidhistory -m -v
If the OU being copied contains computer accounts, you can copy them by using the
following command (or add the primaryGroupID attribute in the list of omitted
attributes in the previous command):
Windows Domain Manager is a command-line tool that has some unique features,
such as moving computer accounts between domains, as well as joining computers
to a domain and renaming domain controllers or computer accounts. The tool allows
you to:
Let us discuss some interesting features of NetDom.exe with some examples. To see
detailed information on how an operation is performed, you may use the /Verbose
parameter with any command. Many tool's commands accept the DNS name of
computers and domains, but sometimes the NetBIOS names are preferable.
Querying Domains
NetDom.exe is one of the tools that allow you to view FSMO roles' owners in the
forest. For example, the following command shows that the server NETDC2 holds all
roles in its domain, whereas all forest-wide roles are owned by the server NETDC4 in
the root domain:
C:\>netdom QUERY /D:subdom.net.dom FSMO Schema owner netdc1.net.dom Domain role owner
netdc1.net.dom PDC role netdc2.subdom.net.dom RID pool manager
netdc2.subdom.net.dom Infrastructure owner netdc2.subdom.net.dom The
command
completed successfully.
The following command displays all domains that have direct trusts with the specified
domain (the trusts may be also verified by using the netdom TRUST command; see
later); notice that the net.dom and NT4DOM domains are connected with a one-way
trust:
The netdom QUERY command can also verify and/or reset (the /Reset parameter)
domain trusts. The following command checks trusts between the parent (current)
domain and a child (the command is executed in the parent domain; the credentials
of the child's administrator must be provided):
When you delegate control over some OUs to a user (jsmith is our example), you
might want to quickly verify administrative power of that user (you must know the
user password). The following command may help you to do this task:
C:\>netdom QUERY /D:net.dom
OU /UD:jsmith /PD:* Type the password
associated with the domain user: List of Organizational Units within which the
specified user can create a machine account: OU=Staff, DC=net, DC=dom
OU=Sales,
OU=Marketing, DC=net, DC=dom The command completed successfully.
Compare this output with the results received for an administrative account.
The command shown below creates a computer account in the domain (but doesn't
join a computer to the domain). Note that you can specify a target OU for that
account. Remember that if you are working on a computer and join it to a domain
using a newly created account, this account by default is added to the Computer
container. You may use the command for pre-creating accounts in the necessary
OUs (domains) before actually joining the computers to the forest.
Caution The computer being moved must be online and accessible, otherwise the
command generates the "The network path was not found" error.
NetDom.exe can verify and reset the secure channels that exist between each
computer in a domain and a domain controller. To verify that the computer COMP3
has an actual secure channel with its net.dom domain, it is possible to use the
following command (the command's output is also shown):
C:\>n1test /sc_query:net.dom
/server:comp3.net.dom Flags: 30 HAS_IP HAS_TIMESERV Trusted DC Name
\\netdc1.net.dom Trusted DC Connection Status Status = 0 0x0 NERR_Success
The
command completed successfully
NetDom.exe allows you to verify domain trusts issues (including those that use
Kerberos v5 authentication protocol). For example, the following command checks
the Kerberos trusts between two domains in the forest (both domain administrators'
credentials must be specified!):
Resetting the
trust passwords between subdom.net.dom and net.dom The trust between
subdom.net.dom and net.dom has been successfully reset and verified The
command
completed successfully
If trust relationship issues exist, you can try to isolate the problem and use the netdom
VERIFY or n1test /sc_query commands to check trusts between pairs of domain
controllers.
Note For verifying and resetting trusts, the Active Directory Domains and Trusts
snap-in (see Chapter 7, "Domain Manipulation Tools") can also be used.
NetDom.exe allows you to remove information (including cross reference and trusted
domain objects) about a non-existing (defunct) domain, which doesn't contain domain
controllers, from Active Directory. The netdom TRUST /Remove /Force command can be
used for that purpose, for example:
netdom
TRUST dotnet.dom /D:net.dom
/Remove /Force
Moving Active Directory objects within a domain is a rather simple operation. You
only need to open the Active Directory Users and Computers snap-in, point to the
object, and select a target container for the Move operation. Moving objects between
domains is a more complicated task, requiring specific tools. When the domains
belong to different forests, then you should talk about migrating rather than moving
objects.
The first two utilities have been included in the Support Tools pack, whereas ADMT
can be downloaded freely from the Microsoft website (see Appendix A).
The main difference between these utilities is that MoveTree operates only in intra-
forest scenarios, and ClonePrincipal only provides inter-forest operations. Besides,
MoveTree destroys the source object (assigning its GUID to the new object), and
ClonePrincipal creates a copy of the object, leaving the source intact. ADMT 2.0 can
provide both migration scenarios. All of the utilities add the original objects' SIDs to
the sIDHistory attribute of target objects.
Every security principal object in non-Windows 2000 mixed mode domains has a
multi-valued sIDHistory attribute. This attribute, as well as the object SID (the
objectSid attribute), is used in an object's access token for granting access to
network resources. If any SID value is presented in the ACL of a network resource,
the object is granted access to this resource (provided that the granted access
permission is Allow rather than Deny). This process is outlined in Fig. 13.1.
Fig. 13.1: The sIDHistory attribute allows a new object to retain the access
permissions granted to the source object
After either ClonePrincipal or MoveTree creates a new object, it adds the source
object's SID value to the new object's sIDHistory list. As a result, the new object will
have access to all resources available to the source object (Fig. 13.2).
Fig. 13.2: The cloned (or moved) object inherits the access rights of the source object
In addition, the sIDHistory list of the source object — if the list is not empty — is
added to the sIDHistory of the target object.
MoveTree is the main tool (and the only standard one, if you exclude the Active
Directory Migration Tool) that allows administrators to reconstruct AD-based domains
which belong to the same forest. This tool can move both single Active Directory
objects and entire containers (OU) from one domain to another. The following objects
are supported:
You cannot use MoveTree to move computer accounts, system objects, or domain
controllers.
Note If you prefer GUI tools, try the Active Directory Migration Tool (ADMT), which
has many additional options when compared to MoveTree. ADMT version 2.0
can be controlled from scripts.
Important The documentation on MoveTree in the Support Tools Help fails to
mention the most important restriction of the tool: the target domain must
be in native mode. Only native-mode domains support the slDHistory
attribute (updateable by the tool) for the security principals. You may not
consider this fact to be a limitation, but do not forget about it while
working with mixed mode domains!
Revise data (such as user profiles, logon scripts, etc.) associated with
user objects being moved. These data are not moved, although the user
objects preserve all settings. You might need to re-create shared volumes
or copy user data, such as logon scripts, before users will be able to
successfully log on to the new domain.
The syntax of MoveTree is quite simple: you must specify the source and destination
of an operation, as well as the operation's type. Practically all parameters are
mandatory. MoveTree has two "modes":
The test mode that checks many conditions without really moving any object
The working mode that initiates or continues a move operation
Moving an OU Subtree
Moving OUs with all their child objects is arguably the most attractive feature of
MoveTree. You must take into consideration the fact that when an OU is moved, it
retains all links with Group Policy Objects (GPOs) assigned to this OU. It is
necessary to re-create these GPOs in the new domain, and break the links with
GPOs from the old domain.
Suppoce, for example, we would like to move the Personnel OU from the net.dom
domain to the subdom.net.dom domain and rename it Staff. You must have
appropriate privileges in both source and target domains. The following "test mode"
command checks whether this operation is carried out correctly (you might also need
to provide administrative credentials for the destination domain):
Notice that the destination OU name differs from the source OU name. Suppose you
got the following messages:
The movetree.chk file (in the same folder where the command has been executed)
always contains diagnostics messages for each step of the command execution
(successful operations have the "0x0" code). This file is generated for each check or
successful move operation. (You may also specify the /verbose parameter with the
command, and all detailed diagnostics will be displayed on the console.) You can
easily locate the problem and source of an error (marked here in bold), for example:
If you delete the reported user object (cn=Dan) from any domain local or global
security group (excluding universal groups and the primary group — Domain Users)
and repeat the command, you will get the following result:
This means that the command has found no errors, and the move operation has a
chance to succeed. Now you can complete the move operation by replacing the
/check parameter with either the /startnocheck or /start parameter. All diagnostic
messages are always written to the movetree.log file located in the current folder.
Attention The "test mode" (with the /check parameter) does not guarantee that the
operation will not fail. For example, the following error ("Insufficient
access rights to perform the operation") may appear only in the "working
mode":
If for some reason a move operation fails to complete, any remaining objects are
placed to the LostAndFound container in the source domain. For example, in the
Windows .NET environment, such a situation can occur if you try to move an OU
containing computer accounts. To solve this problem, view the operation log, delete
or move conflicting objects from the LostAndFound container, and restart the
operation using the /continue parameter. When the move operation is successfully
completed, this container will be empty (if there are no failed operations that move
other directory objects).
The destination container must already exist before a user or group account is
moved. The object can be renamed when moving; you only need to specify the
appropriate distinguished names along with the /sdn and /ddn parameters.
Local and global groups must be empty when moved. (Only universal groups retain
all their members when moved.) Otherwise, a message similar to the following will
appear in the movetree.chk file:
or
ClonePrincipal is not really a utility or command, but a set of scripts that allows
administrators to perform inter-forest migration, primarily to incrementally migrate
(copy) accounts from an existing Windows NT 4.0-based domain to a new Active
Directory domain (based on domain controllers running Windows 2000 or Windows
.NET). (In contrast to MoveTree, ClonePrincipal does not affect the source objects.)
ClonePrincipal can also be used for reorganizing AD-based forests. This tool and its
GUI counterpart — the Active Directory Migration Tool (ADMT) — are the only
facilities used for upgrading existing Windows NT 4.0-based domains in cases when
users can preserve continuous access to network shared resources and
administrators can fulfill fallback in case of an emergency.
Note ADMT is a more powerful and user-friendly tool than ClonePrincipal. ADMT has
many additional features, for example, it also supports intra-forest operations,
and can migrate user profiles, computers, and trusts. ClonePrincipal and ADMT
have quite a few similar features. However, they differ internally, and Microsoft
does not recommend that you mix these tools for migration operations. If you
learn ClonePrincipal's basics (especially the environmental requirements and
mechanism of SID migration), you will be able to master ADMT without any
problems.
A unique Security Identifier (SID) of a security principal (i.e., user, computer, or group
account) is used to grant access rights to shared network resources to a principal.
The SID is composed of two parts: a unique "domain part", which is the same for all
principals within the domain where they reside, and a Relative Identifier (RID), which
uniquely identifies the principal in the domain.
Note Windows .NET domains offer a new security principle — class inetOrgPerson.
You can use objects of that class in the same way as the user objects and
assign them permissions on shared resources and directory objects.
An account with a well-known RID has an SID composed of an RID that is identical in
every domain, and a "domain part" that is unique for each domain. Such an account
can only be cloned onto an account with the same RID. Here are accounts with well-
known RIDs:
Administrator
Domain Admins
Domain Guests
Domain Users
Guest
An account with a well-known SID cannot be cloned, since its SID is identical in every
domain. (Therefore, it doesn't make sense to copy an account whose SID already
exists in the target domain.) Here are accounts with well-known SIDs:
Account Operators
Administrators
Backup Operators
Guests
Power Users
Print Operators
Replicator
Server Operators
Users
User accounts
Security group accounts:
Local groups (from Windows NT 4.0 or Windows 2000 mixed mode
domains)
Global groups
Domain local groups (from at least Windows 2000 native mode Active
Directory domains)
Universal groups (from at least Windows 2000 native mode Active
Directory domains)
ClonePrincipal Components
One of the most important requirements for ClonePrincipal (as well as for ADMT) to
work well is the proper configuration of both source and target domains. If you are
also planning to use ADMT, see also the additional requirements below.
ClonePrincipal will fail if any of the requirements have not been met.
If ClonePrincipal was installed separately from the Support Tools, make sure
that the Clonepr.dll has been registered on the target DC.
All ClonePrincipal scripts must be run on the PDC Emulator (the FSMO role
master) of the target domain.
You must log on to the DC as a member of the Domain Admins group of the
target domain.
In the source domain running Windows NT 4.0 (with Service Pack 4 or later) or
Windows 2000/.NET, create the registry REG_DWORD:0x1 value named
TcpipClientSupport on the PDC (or the PDC Emulator) under the following subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
This setting is not necessary if you use ADMT for intra-forest migration.
Audit Settings
It is necessary to set auditing, both in the source and target domains. Use the
procedure described below.
For Windows 2000 and Windows .NET domains (both the source and target):
1. Open the Group Policy Object (GPO) for the Domain Controller OU. (Use
either the Domain Controller Security Policy or the Active Directory Users
and Computers snap-in.)
2. Open the Security Settings | Local Policies | Audit Policy node.
3. Double-click the Audit account management policy and check both the
Success and Failure boxes. Click OK. A sample screen is shown in Fig. 13.3.
Refresh the computer policy or wait for the updates to take place.
Fig. 13.3: Setting audit on the Windows 2000-based domain controllers
In either a Windows NT 4.0- or AD-based source domain, you must create a special
domain local group that is used for auditing cloning operations. The name of the
group is composed of the source domain NetBIOS (pre-Windows 2000) name
appended with three dollar signs, for example, NT4DOM$$$. The group must be
empty. Without this group, you will not be able to transfer SIDs between forests and
update the sIDHistory attribute of target objects.
This group is not required if you use ADMT for intra-forest migration.