LDAP  Lightweight Directory Access Protocol  RFC1777

-  X.500 Directory access without fulfilling all DAP requirements
-  simple API (in comparison to X/Open XDS)
-  element transfer using transport layer (bypassing session / presentation layers)
-  majority of string operations
-  encoding (BER)
-> WIKI: http://cs.wikipedia.org/wiki/LDAP


ACTIVE DIRECTORY

"Active Directory is a directory service and, like any directory service, its ultimate purpose is to store information about users, resources, and other network entities, and to provide that information to anyone or anything that has access to the directory, according to access permissions. This information helps administrators to manage the network and users to find people and resources."


-> HISTORY


-  X.500 is an international standard for directories and LDAP is a popular protocol for accessing directories.


-> WHAT IS AD AND WHAT IT IT NOT


-  It is not a relational database (like SQL Server). Information is stored in form of objects. 
   o  Objects may be created for user, group, and computer.
   o  There are also objects for contact people, printers, shared folders, application services, other resources, and configuration information.   

-  Directory for storing network resources info
-  Services for accessing the stored info
-  Tool for both administrator and end-user
-  Permissions allow control over which users will see what information.
-  Because all changes (are likely to) need to be copied to several domain controllers, both in the same building as well as perhaps to offices located on other continents, the information put in Active Directory should be "globally" useful and relatively static, and each piece should not be very large.
-  AD is optimized for a high number of reads.


-> INFORMATION CATEGORIES IN AD


-  In general, the information in Active Directory falls into one of two categories.

1) Certain information in certain objects is significant (as we call it), which means that it affects how some aspects of Windows work. For example, significant information controls when and how network users can log on or which services they can use.
2) The remaining information is informational (e.g., Jack's postal address). It may be interesting and useful to people or directory-enabled applications, but Windows doesn't use this information itself. Consequently, informational data doesn't have the controlling aspect of significant information.

-  The information is highly typed, which means that Active Directory enforces rules for the structure and content of the information.
-  Allowance of standards-based read and write access using the LDAP protocol. Additionally, LDAP allows effective searches on the information in Active Directory.

-> OTHER

-  The information in Active Directory is highly available because identical information is on several servers (called domain controllers).
 
-> FEATURES (in W2k3)


-  Centralized data store
-  Scalability
-  Extensibility
-  Manageability
-  Integration with DNS
-  Client configuration management
-  Policy-based administration


-> BUILDING BLOCKS OF AD


"Active Directory has a number of building blocks, beginning with domains, which you create by installing domain controller servers. Domains have _trust relationships_ between them. Active Directory information must be replicated between domain controllers, whether they are located in the same or different _sites_. You can organize the objects in Active Directory in organizational units." (see figure AD_buildingBlocks.bmp)


--> DOMAIN CONTROLLERS

  When you install Active Directory on a Windows 2000 or Windows Server 2003 server computer, you promote it to a domain controller (dcpromo tool). During the Active Directory installation, you have the option to create a new domain or to join the server to an existing domain. 
  
Note: Each domain controller belongs to exactly one domain (as does every member server and workstation that is joined to a domain).

[Review]:
- user authentication
- hold, manage changes, and replicate complete copy of all Active Directory information for the domain
- multimaster replication (DSs are peers) + Operation master roles
- collision detection
- fault tolerance


--> DOMAINS


  A domain is maintained by one or (preferably) more domain controllers. The domain controllers of one domain may reside in one or more physical locations. An organization may choose to have one or more domains. Each domain is three things at the same time:
  
  1) A unit of replication. When you add a user or another object to an Active Directory server (i.e., a domain controller), that object is replicated to all other domain controllers in that domain. The outcome is that all the domain controllers in one domain contain the same Active Directory information (except when there has just been a change that hasn't yet reached the other domain controllers).
  
  2) Part of the DNS namespace. Therefore, each domain has a DNS name, such as sales.sanao.com. In other words, each Active Directory domain is also a DNS domain.
  
  3) An administrative unit. The people who create a domain usually have control over its domain controllers and Active Directory information. The groups Domain Admins, Account Operators, and Administrators have various administrative rights to the domain controllers of the domain and permissions to Active Directory information of the domain, and these rights and permissions are domainwide. A domain also acts as a security policy boundary, so there are some security settings (password policy, account lockout policy, and Kerberos policy) that affect the whole domain.

[Review]: 

- Windows domain name ? DNS name
- It contains basic objects like:
  - printers, documents, e-mail addresses, 
  - databases, users, distributed components, and 
  - other resources
- security
  - access control lists (ACL)
  - no rights cross the domain border
  - domain administrator is an absolute emperor for and only for the domain
- Domain Functional Level (= domain mode)
  - AD behaves according to the historically oldest DC in Domain


--> FOREST  


- alliance of independent trees, which share
  - common schema
  - common configuration (AD infrastructure)
  - common global catalog
  - implicit 2-way trusts
  - different name structure
  - independent functionality (but with the possibility to communicate)


--> TRUST RELATIONSHIPS


If an organization has more than one domain, its domains might be totally separate (that is, each in a separate Active Directory forest). More likely, though, they are connected with trust relationships.

The advantage of having trusts between domains is that you can give a user or group in one domain permission to access a resource in another domain. Thus, if a user needs to access the resources in two domains, there is no need to make two user accounts for him or her. Another benefit is that groups can have members from other domains. Consequently, trusts also enable centralized administration from one domain to another.
 

--> ORGANIZATIONAL UNITS AND OTHER OBJECTS


An administrator using Active Directory creates a user object for each user, a printer object for each shared printer, and so on. Other object types include computer, group, and shared folder. The administrator does not create all objectssome are created automatically by Active Directory or some other software, especially during installation.

You can create organizational units in Active Directory domains just as you create folders in a file system. You can store objects in different OUs just as you store files in different folders in a file system. This way, you can store them in logical groupings in a tree structure, which is especially useful if you have many objects.

In addition to this logical grouping of objects, you can use OUs for the following purposes:

1) You can delegate the administration of each OU (including users and other objects there) to a different administrator. 

[For example, in a geographically dispersed network, perhaps covering several time zones, it is probably easier to give the local administrators permission to create user objects, reset forgotten passwords, and so on. Delegation of administration is implemented with permissions.]

2) You can control how end-users see, read, and modify the objects and their properties in each OU by specifying various permissions to users to access the OU contents.

3) You can assign different group policies to the users and computers in each OU.

NOTE: You can assign permissions (to read, write, create, and so on) per object, not just per OU. However, this is usually impractical and a better choice is to stick to the per-OU permissions.

Unfortunately you cannot assign (security?) permissions to OUs. This means that if you have an OU that contains 30 users, you probably need to create a security group and put those users in this group in order to give them permissions for specific folders or other resources.

You should create OUs to match administrative units. They are usually physical locations, object types (e.g., users in one OU and printers in another), or the organizational structure. In the last case, for example, the top-level OUs could be Human Resources, Finance, and Marketing. Below the top-level OUs created with one criterion, you can create second-level OUs (and below) based on another criterion.

[Review]:
- LDAP container, part of LDAP namespace (not DNS namespace)
- hierarchical structure
- user and group rights inheritance


--> GROUPS


You can use groups in Active Directory for at least two purposes. It is easier and more efficient to give access permissions to groups than it is to give them to a large number of individual users or computers. You can also use groups as e-mail distribution lists, given that your e-mail application can read the lists from Active Directory. This leads to two group types:

1) DISTRIBUTION GROUPS can be used as distribution lists in Active Directorycapable e-mail applications and for any other Active Directorycapable application. For example, an application could control the doors of your company and let only people in a certain distribution group go through a certain door. This may sound like a security-related function, but the point is that there is an application that uses this distribution group for something, but Windows doesn't use the group for anything.

2) SECURITY GROUPS are everything that distribution groups are. Additionally, you can assign Windows access permissions to a security group, while you cannot do so to a distribution group. That is, a security group can be given permissions for various parts of the operating system, such as Active Directory or a file system.

NOTE: Windows uses only security groups; it does not use distribution groups.

Every group, whether a distribution or a security group, has a defined scope. There are three group scopes:

-  Global
-  Universal
-  Domain local

Instead of giving permissions for resources directly to users or computers, you can put them in groups and give the access permissions to these groups.


--> SITES


Administrators create sites as areas with "good connectivity." Typically, each LAN would be a site, and the WAN connections between these sites (i.e., LANs) would be called site links. Technically, you define a site as one or more TCP/IP subnets.

Why do we need sites? They help Active Directory to understand what the world and physical network is like. When Active Directory knows which servers are on the same site, it knows whether there is a fast or slow communications link between any two servers. For slow links (i.e., intersite), domain controllers compress the replicated data, but for fast links (i.e., intrasite LANs), they save processor cycles and send the data uncompressed. You can also define for each site link a cost parameter that determines the route Active Directory will use to replicate between multiple sites.

NOTE: The cost parameter determines only which domain controllers will communicate when replicating. It doesn't affect the physical IP routing (unless some router vendor makes a router that would understand the costs of Active Directory site links).

USAGE OF SITES:

  1) Active Directory can decide how to replicate information efficiently between domain controllers. If the domain controllers are not on the same site, Active Directory uses several optimization techniques in replication.
  
  2) Active Directory clients find the closest logon servers (i.e., domain controllers) based on sites.
  
  3) The Distributed File System (DFS) of Windows 2000 and later can use site information to make intelligent decisions about which server a user is directed to when she requests a file.
  
  4) The File Replication Service (FRS) of Windows 2000 and later uses sites to know how to replicate SYSVOL and other folders that you assign to be replicated.
  
  5) An administrator using Active Directory can assign group policies to sites.
  
  6) Active Directoryaware applications may use site information for their own purposes.

SITE LINK COST

  Site link cost is an attribute of a site link. Each site link has been assigned a default cost of 100. The knowledge consistency checker (KCC) uses the site link cost to determine which site links should be preferred for replication. It should be remembered that the lower the site link cost, the more preferred is the link. 
  
[Review]:
- 1+ subnets
- site is a set of IP subnets
  - connected by fast and reliable link (usually LAN)  
- not part of namespace
- Sites structure usually mirrors the structure of real users location
- Site goals
  - Autorization
  - Intersite replication
- Site configuration
  1. Site creation
  2. Subnet creation and association with a 
  3. Creating DCs in the Site or moving DCs into the Site
  4. Set Site licence server   
  -> Site has a DC!
- Subnetting
  - Every Site must contain at least 1 Subnet
  - A Subnet may belong to only 1 Site 
- Why create Sites?
  - For every LAN or LAN group connected using hi-speed network
  - For every place without direct connectivity to the rest of the network 
    but with SMTP connectivity
  - For networks interconnected via uneven connections
  
  
--> REPLICATION


Each piece of Active Directory information should reside on more than one domain controller. This setup provides:

1) fault tolerance against a server failure. 
2) Another benefit is load balancing when many workstations are accessing Active Directory simultaneously. 
3) The third advantage is proximity of informationwhen a domain controller is placed on the same site with users and Active Directory information is replicated to that domain controller, workstations get the information from a local server instead of across a WAN link.

For the information to reside and stay current on several domain controllers, changes must be replicated from one server to another. In other words, the information is kept up-to-date by periodically copying the changes in one domain controller across the network to the other domain controllers of that domain.

NOTE: Not all Active Directory information is replicated. For example, each domain controller tracks when a user last logged on using that domain controller. This information is part of the user objects, but it is a nonreplicating property. Also, the Active Directory database contains indexes of the properties that are marked (either in the base configuration or by an administrator) to be indexed. Each domain controller builds these indexes locally.

Remember that domains are units of replication, but sites tell when and how to replicate. Inside a site, domain controllers initiate replication after having waited 15 seconds or 5 minutes after a change (in Windows Server 2003 and Windows 2000, respectively). In this case, they use direct remote procedure call (RPC) connections.

When you add more than one domain controller to a site, Active Directory builds a certain replication topology. If there were ten domain controllers, a bad topology would be one long chain. This would mean that domain controller A would replicate to B (one hop), which would replicate to C (a second hop), which would replicate to D (a third hop), and so on until domain controller J (a total of nine hops). The chain would be so long that replicating changes from A to J would take too much time and J would fall behind. In addition, a long chain is not as fault tolerant. For these reasons, Active Directory takes care that the replication chain is on the average no more than three hops from one domain controller to another. Active Directory achieves this by arranging the domain controllers in a ring topology and adding shortcuts across the ring (unless you turn off the shortcut creation).

Between sites, Active Directory compresses the replicated data. The replication takes place by default every 3 hours, but an administrator can change that to another interval (e.g., once an hour or every 30 minutes), down to a minimum of every 15 minutes. Alternatively, if an organization has good WAN links, it can choose to use intrasite delays (15 seconds or 5 minutes) also in intrasite replication. RPC is usually used, as in the intrasite case, but you can also choose SMTP messaging (automated e-mail).

The SMTP option uses the Intersite Messaging service, which is part of Windows 2000 and Windows Server 2003. However, you can use SMTP instead of RPC to replicate only the enterprise forest information between domains, or application partitions (explained later in this chapter). Normal domain replication must always use RPC.

Active Directory uses multimaster replication. This means that you can make changes, such as adding users, to any domain controller (of the appropriate domain). Your changes are then replicated to all other domain controllers in the same domain. 

Active Directory replicates only changed properties, not entire user accounts as in Windows NT. Unlike Novell NDS, Active Directory replication does not rely on synchronized time in different servers to determine what to replicate. Instead, Active Directory uses update sequence numbers (USNs) and version numbers.

NOTE: There is a time synchronization service under Active Directory. It is needed mainly because the Kerberos authentication protocol requires the workstation clock to be within 5 minutes (by default) of the server clock, and the server clocks within 5 minutes each other. Successful Kerberos authentication ensures, among other things, that domain controllertodomain controller replication is possible  --  servers await the replication only in scheduled 5 minute-interval and then they don't until next scheduled interval.  

[review]:

- Glossary
  - all objects are represented in a directory tree
  - Every DC stores a part  directory partition (naming context)
  - Replica  A copy of directory partition, R/W 
    "When we talk about replication, we also need to talk about PARTITIONS and 
    REPLICAS. Partitions are the units of replication; that is, they dictate 
    what is replicated to which domain controllers. Replicas are the identical
    copies of a given partition in different domain controllers."
  - Partial replica  A subset of replica stored on GC, R/O
  - isMemberOfPartialAtributeSet = TRUE
  - Replicas are synchronized with other DCs in the domain


--> ROLES OF DOMAIN CONTROLLERS


Although normal Active Directory replication is multimaster, all domain controllers are not equal. There are two forestwide and three domainwide roles, which are held by only one (per forest or per domain) domain controller at a time.

The five roles are called OPERATIONS MASTERS, or FLEXIBLE SINGLE-MASTER OPERATIONS (FSMOs). As the name implies, they work in a single-master fashion, meaning that a particular domain controller is needed for a particular operation.

The two forestwide roles are:

-  Schema master
-  Domain naming master

The three domainwide roles are

-  RID master (where "RID" stands for "relative identifier")
-  PDC master (or PDC emulator)
-  Infrastructure master


--> GLOBAL CATALOG


In a large network with many domains and sites, it is not appropriate for all Active Directory information to replicate to all sites. This raises the possibility that only part of the information needed is at the same site as the user. Without some mechanism to tie these domains together, if that user searched the Active Directory for other users or for resources such as printers, the user's query would travel from site to site across many WAN links to collect all the requested information, which is not efficient. Also, if the result were a list of 1,000 user names, it would be slow to transfer back to the user who performed the search.

To avoid such time-consuming and costly steps, the global catalog helps to do all searches in your entire enterprise forest locally, which should dramatically increase their efficiency. The global catalog contains some basic information about every object in the whole Active Directory forest. It contains properties that are likely to be used in search operations, such as a user's first and last name.

One of the global catalog properties is the distinguished name of each object. It specifies the domain name and complete path to the object, which makes it easy to locate the object. To read properties that are not in the global catalog, your workstation must contact a domain controller of the domain where the object is; the distinguished name will be needed in this location process.

Out of the box, the global catalog contains 151 of all 1,070 properties (or 138 of 863 in AD2000). If you want, you can define additional properties to be included in the global catalog.

Administrators designate which domain controllers host a copy of the global catalog. After that, replication of the global catalog occurs with the normal replication of the Active Directory, so any changes will be replicated as soon as any other changes. 

Information in the global catalog is subject to the same per-object and per-property permissions as normal domain data. Additionally, the global catalog is read-only.

Normally, there should be at least one global catalog server on each site, but sometimes it is better to leave some sites without a global catalog server, in which case the users of those sites have to read the information in the global catalog over a WAN link. Alternatively, those users do not use the global catalog at all.

[Review]:
- created automatically on the first DC in the first domain in the forest
- contains partial information about every item in the forest

[Example of query]:

1) client  DNS: Who is Global Catalog?
2) DNS  client: IP of designated DC 
3) client  GC: query
4) GC: lookup in GC
5) (not in GC  try AD)

Communication is on ports:
- GC query: port 3268
- AD query: port 389


#
# Hierarchies in AD
#

Depending on the size of the network, an administrator will probably build some kind of structure and hierarchy into Active Directory. The five models from the simplest and smallest to the largest are as follows:

-  Single domain with no OU structure
-  OU tree in a single domain
-  Domain tree (with an OU tree in each domain) - trust relations between domains
-  Forest of domain trees (with an OU tree in each domain) 
 
 o As with a single domain tree, a forest of domain trees has the transitive 
   and two-way trusts for access permissions and group assignments, as well as 
   a common schema and global catalog.
   
-  Multiple forests



[Reason for splitting a domain into two or more]: ... Because a domain is a unit of replication and there is just one domain in this model, all information is replicated to all domain controllers on all sites. This is a good thing if your WAN links can handle the resulting (compressed) amount of replication of all the changes. If not, you should evaluate using multiple domains, so that you would have one of the remaining two models, a domain tree or a forest.

#
# DNS INTEGRATION IN AD
#

"Active Directory has a close relationship with DNS, the naming system used for the Internet and many intranets. Active Directory uses DNS for two related purposes: 

1) naming domains and computers and 
2) locating servers and (Active Directory) services. 

Therefore, to use Active Directory, the DNS service must be running on the network. The foremost choice is to use the DNS service included in Windows 2000 or later. Another possibility for companies is to continue using their existing DNS infrastructure."

-> Points of interest: 

A DNS zone is a portion of the global Domain Name System (DNS) namespace for which administrative responsibility has been delegated.
 
 
 
 
#
# SECURITY AND POLICIES IN AD
#

- Anyone who wants to access information in Active Directory or the file system must be authenticated, usually with a username and password, and then be subject to discretionary access control.
- There is a security descriptor (SD) attached to each object in Active Directory. 
- You assign permissions to security principals. They are users (and inetOrgPersons), security groups, computer objects, and well-known security principals.

-> Inheritance

- Active Directory uses static inheritance for object permissions. The word "inheritance" means that when you add permissions for some OU or other container, you can specify that these new permissions apply also to the child objects. You can choose to which type of children they apply and whether the permissions apply only to immediate children or to the whole tree beneath the object. Also, for each object, you can choose whether it will allow inheriting permissions from above.

- STATIC INHERITANCE means that Active Directory copies the new permissions to the access control list of each appropriate child object. This copying takes some processor power, as well as space in the Active Directory database, but the advantage is that when the objects are later accessed, Active Directory doesn't need to walk up the tree to check for inheritable permissions.

-> DELEGATION OF ADMINISTRATION

- Because you can set access control by the OU, by the object, and even by the property, you can delegate administration of all or part of your OU tree.

-> GROUP POLICY

You can use Group Policy to centrally manage users' working environment and workstations. Group Policy also affects servers, and administrators use it to define, apply, and enforce the following:

1) Automated application installation (either forced or optional)
2) Forced registry settings to users or computers
3) Security settings
4) Logon/logoff scripts and startup/shutdown scripts
5) Folder redirection of the Start Menu, Desktop, My Documents, and Application Data folders so that they can be located on a network server instead of the normal user profile folder
6) Some settings for Remote Installation Services (RIS)

Part of the Group Policy settings affect computers, and the remaining settings affect users. You store the settings in Group Policy objects, or GPOs, that you create for chosen sites, domains, and OUs (despite the name, you cannot assign GPOs directly to groups, nor can you assign GPOs to individual users or computers). The locations of the user objects and computer objects determine which GPOs apply to each user and computer.

AD2003 contains a new feature called WMI filters. They enable you to assign GPOs dynamically based on certain criteria. A typical example is to apply a GPO only to those workstations that have at least 10GB of free disk space. 


#
# AD ARCHITECTURE 
#


-> DATA MODEL

Active Directory stores information about users, resources, and other network entities. The stored information is represented as objects, so there is an object for each user, computer, printer, and so on.

[Def. class] Objects of the same type belong to the same class, such as (again) user, computer, and printQueue. Out of the box, Active Directory supports 191 classes (or 142 in AD2000). 

Every class defines a set of mandatory and optional properties that the objects belonging to the class must or may have, respectively. A property is often called an attribute. Out of the box, Active Directory has a total of 1,070 properties (or 863 in AD2000) and the user class uses 257 of them (or 207 in AD2000). Fortunately, you don't need to enter data in all of the properties when you create a user account. Examples of user properties are sn (surname) and homePhone.


-> THE SCHEMA


The schema is a set of rules that dictate which object classes a directory can contain, the object relationships, and the possible content of each object. This is true for Active Directory, as well as other directory services. In other words, the schema governs the structure and content of Active Directory. For example, the schema states which object classes, attributes, and syntaxes your Active Directory can contain. It specifies the mandatory and optional attributes of each class and indicates whether an attribute is indexed. In addition, it defines which attributes are replicated to the global catalog.

Classes can inherit from one another. For example, there is a class called person that has, among other attributes, sn (surname) and telephoneNumber. Another class, organizationalPerson, inherits all attributes in person, and adds title and facsimile TelephoneNumber. Finally, the class _user_ inherits all attributes in organizationalPerson and adds attributes such as homeDirectory and badPwdCount.

In addition to the inheritance chain, the user class gets a number of attributes from the auxiliary classes mailRecipient and securityPrincipal.

NOTE: You may wonder about the strange names of some attributes. Many of them come from the X.500 standard.

[Review]: the schema defines object which may reside in AD
- schema itself is stored in AD
- dominance of querries to changes
- Schema objects (metadata)
- schema class objects
- schema attribute objects

-> EXTENDING THE SCHEMA

Schema changes require careful planning and testing because many of the changes have implications for the whole enterprise, and they are sometimes irreversible (at least without reinstalling the forest). Fortunately, Active Directory has many restrictions and guarding mechanisms to prevent disastrous changes.


-> PARTITIONS


As mentioned earlier, an Active Directory domain is a unit of replication. A unit of replication is called a partition, or sometimes a naming context (NC). This means that a domain is a partition. However, domain is not the only type of partition. Every domain controller holds a copy of the following three partitions:

1) The DOMAIN PARTITION, where users, groups, OUs, and such reside
2) The SCHEMA PARTITION, where schema classes and attributes reside
3) The CONFIGURATION PARTITION, where information on the forest structure resides, such as the sites and domains

In addition to the three partitions just listed, a Windows Server 2003 domain controller may hold copies of APPLICATION PARTITIONS.

Information in the first partition (i.e., users, groups, and so on) is replicated among the domain controllers of one domain, whereas the schema and configuration partitions are replicated among all domain controllers in the forest. A copy of a partition in a given domain controller is called a replica.

The domain controllers that are designated as GLOBAL CATALOG servers hold a partial copy of all other domain partitions of the forest. A partial copy contains all objects, but it contains only those attributes that are part of the global catalog.

[review]:

REPLICATED DATA
  - Schema partition
    - definitions of all object classes, which may be in the forest
    - definitions of all object attributes
    - replicated to all DCs in the forest
  - Configuration partition
    - logical structure of the forest (domain structure, replication topology)
    - replicated to all DCs in the forest
  - Domain partition
    - objects which belong to a domain
    - replicated only to DCs in the specific domain
  - Application directory partition
    - only on DCs with W2k3
    - used by applications to store nearly everything 
      (except security principals)
    - may be configured to replicate to arbitrary chosen DCs in the forest 
      regardless on their domain

REPLICATION TRIGGERS
- object creation
- object change
- object move
- object deletion

REPLICATION TYPES
- Intrasite
  - data not packed
  - DCs notify the other DCs and then download the changes
  - periodic polling
  - RPC
- Intersite
  - data bigger than 50kB are packed
  - no notifying
  - polling based on the schedule, if an action is needed, it is planned 
  - IP or SMTP

INTRASITE REPLICATION

"Knowledge Consistency Checkers (KCCs) automatically create topologies for both intrasite and intersite replication. When determining the optimal topology, KCCs base their decisions on replication objects such as sites, site links, and domain controllers (or to be exact, the NTDS Settings objects). If there are changes in these objects, the KCCs automatically make the necessary alterations. They also monitor replication for problems that would necessitate temporary or permanent changes in the topology."

An automatically created intrasite replication topology forms a bidirectional ring between DCs. Each domain controller establishes an inbound replication partnership with two other domain controllers.


[review]:
- KCC  Knowledge Consistency Checker
- automatic creation and optimalization of replication topology 
  (connection object - IN)
- KCC assings Bridgehead server for the Site
  - Preferred bridgehead servers may be assigned manually, 
    but beware of the failures


INTERSITE REPLICATION

"The intersite replication topology is based on BRIDGEHEAD SERVERS. They are the only domain controllers that replicate to and from other sites. A bridgehead server collects all changes on its site in the partitions it is responsible for, and then replicates the changes to bridgehead servers on other appropriate sites. Those bridgehead servers in turn replicate the changes further on their sites. This way, any change needs to travel a WAN link only once."

- using manually created Site Links and then KCC 
  (how: http://technet.microsoft.com/en-us/library/cc783068(WS.10).aspx)
- default = transitive (Bridge All Site Links) if disabled, 
  consider creating Site link bridge

- Protocols
  - DS-RPC  Directory Service Remote Procedure Call
    - IP site link, synchronous 
    - live, fast, and reliable connection is needed
    - based on schedule
    - no CA needed
  - ISM-SMTP  Inter-Site Messaging  Simple Mail Transport Protocol
    - SMTP site link, asynchronous
    - for unreliable connection
    - not based on schedule
    - CA needed for message authentization

  [Selecting]
  - Intrasite  always RPC over IP
  - Intersite  RPC over IP or SMTP
    - SMTP only between DCs in different domains
    - DCs in one domain must use RPC over IP

- Bridgehead servers
  - for the communication between Sites  KCC 
    contacts apropriate Bridgehead server in the distant Site
  - Preferred bridgehead servers may be set  manually 
    (more than 1, but active is just 1 at a time)
    - Drawbacks:
      - firewalls must be set to allow the communication
      - When the preferred bridgehead server fails, next one 
        in the list is used. If all in the list are unavailable, the 
        replication does not start even if there are other servers 
        able to replicate

Note: Active Directory replication topology is computed by the KCC according to a spanning tree algorithm. 

-> THE X.500 STANDARDS


The Active Directory data model (classes and so on) is derived from the X.500 data model, and Active Directory implements many X.500 features. Examples are a subset of the 1993 version of Directory Access Protocol (DAP), Directory System Protocol (DSP), and Directory Information Shadowing Protocol (DISP). However, Active Directory is not a full X.500 directory service. Microsoft has stripped away more complex and unnecessary features. Also, Active Directory uses LDAP, which makes some difference.


-> LDAP


The Lightweight Directory Access Protocol (LDAP) is a simplified version of the more complex DAP, and it runs on the more popular and light TCP/IP, rather than ISO/OSI. Clients can use LDAP to connect to and be authenticated to directories and to search and modify information in them either over the Internet or inside an organization. Active Directory is also a directory, and Windows 2000 and later clients access Active Directory using LDAP. This includes also the network traffic that various administrative tools generate. In other words, clients "talk LDAP" when they read or write information to Active Directory domain controllers.

NOTE: Although in the next section we list the other access methods, we want to emphasize that almost all access to Active Directory takes place with LDAP.


-> PHYSICAL ARCHITECTURE

Whenever Active Directory modifies some information, it does so through TRANSACTIONS. This means that the requested Modify operation is atomicthat is, it either completes in full or it is not applied at all. Each transaction is first written to a transaction log, and if this succeeds, the information is also stored in the actual database (NTDS.DIT). This protects the database from corruption, and any decent database product, such as SQL Server, uses a similar technique. Generally, directory information is mostly searched and read; the transaction logs are needed only when the information is modified.

-> KERBEROS AUTHENTICATION

Active Directory uses Kerberos version 5 (RFC 1510) as its primary authentication method.

[Principle]: Kerberos is based on tickets. When a workstation starts up or a user logs on, the workstation contacts a Kerberos key distribution center (KDC), which is a service running on all domain controllers. The KDC returns a ticket-granting ticket (TGT), which the workstation caches for later use. The user needs the TGT when she wants to start a session with some server. In this case, her workstation acquires a session ticket from the KDC for that server. Figure 1.19 illustrates the computers and the tickets. (SEE kerberos.png)

[Interesting properties]:

1) Fast session authentication. When a client connects to a member server in a domain, the client offers its session key. The key has enough information for authentication, so the server does not need to contact its domain controller to check the user's validity. This speeds up client connections, especially when many clients are accessing one server.

2) Impersonation. If a client makes a request to a server (server B in Kerberos.png), and in order to fulfill it the server makes a request to another server (server C in Kerberos.png), the first server can impersonate the client to the second server. That is, it gets the data using the client's credentials, not using some fixed account for all users.

3) Mutual authentication. Not only does the server know that it is talking to the correct client, but it is also possible for the client to know that it is communicating with the correct server.


-> PUBLIC KEY INFRASTRUCTURE


Active Directory supports public key technology. In other words, they can use X.509 version 3 certificates with private/public-key pairs. This is referred to as public key infrastructure (PKI). You can choose to buy certificates from a commercial certificate authority (CA)for example, VeriSignor you can create certificates yourself using the Certificate Services included in Windows 2000 and Windows Server 2003. In either case, the certificates may be stored in Active Directory, so you and your users can use them for the following purposes:

1) File encryption with Encrypting File System (EFS)
2) E-mail encryption
3) Web browser traffic encryption (i.e., HTTPS)
4) TCP/IP traffic encryption (i.e., IPSec)
5) Logon and authentication
6) Use of digitally signed drivers and system files (AuthentiCode)

Windows 2000 and later also support smart cards, which could be described as "credit cards with processor and memory." They are a very secure place to store users' private keys. You can use a smart card and a personal identification number (PIN) for logon instead of a traditional username and password, which increases logon security dramatically.


#
# OPERATION MASTER ROLES
#

[Review]:
- Active Directory supports Multimaster Replication
  - But not for everything  there exist single-master operations:
    - Schema master
    - Domain naming master
    - RID master
    - PDC Emulator
    - Infrastructure master
  - Assigned to selected domain controllers, function must be assured
  - aka FSMO Roles  Flexible Single Master Operations
- Role planing
  - Defaults work only in singular cases
    - only 1 DC in the forest
    - only a few DCs in the forest, the forest is in one Site
  - Otherwise, the roles must be spread
    - load balance
    - DC maintenance, hw upgrades, crashes
- Roles at domain creation time
  - The first server in the forest gets all(!)
    - forest: Schema Master, Domain Naming Master
    - root domain:  RID Master, PDC Emulator, Infrastructure Master
  - The first server in child domain gets all domain-specific roles
    - RID Master, PDC Emulator, Infrastructure Master


-> SCHEMA MASTER


- all updates and modifications to the schema
- forest-wide; only 1 in the forest


-> DOMAIN NAMING MASTER


- addition and removal of domains in the forest
- forest-wide; only 1 in the forest


-> RID MASTER RELATIVE IDENTIFIER


- allocates sequences of relative IDs to DCs in its domain
- domain-wide; only 1 in every domain

  - every object is identified by its own unique security ID formed by domain
    security ID and relative ID which must be domain-unique regardless on the
    originating DC
  - object transfer between domains is initiated at RID Master DC


-> PDC EMULATOR (Primary DC Emulator)

[Usage]: 
1) When a user changes his password on any domain controller, the change is pushed by the Netlogon service to the PDC master on a best-effort basis (not part of replication). This is beneficial if the user immediately tries to access some other server and his new password hasn't yet been replicated to every domain controller. If the authenticating domain controller notices that the user's password doesn't match, it can check with the PDC master to see if there is a new password for the user. The changed password is also normally replicated to other domain controllers.
2) All user and computer ACCOUNT LOCKOUTS are processed on the PDC master. This way, both the setting of lockouts and the releasing of lockouts happens instantly without a replication delay.
3) The PDC master of each domain is the PREFERRED TIME SERVER over the other domain controllers 

[Review]:
- acts as Windows NT PDC
  - processes password changes
  - replicates updates to BDCs
- domain-wide; only 1 in every domain
- Even when Windows Server 2003 Functional level is set, PDC Emulator is used:

"password replication takes some time => when autentification fails at certain DC (bad password), it is forwarded to PDC Emulator  he is THE one who knows"



-> Infrastructure Master


The Infrastructure Master maintains security identifiers, GUIDs, and DN for objects referenced across domains. Most commonly it updates user and group links.This is another domain-specific role and its purpose is to ensure that cross-domain object references are correctly handled. 

[example]: If you add a user from one domain to a security group from a different domain, the Infrastructure Master makes sure this is done properly. As you can guess however, if your Active Directory deployment has only a single domain, then the Infrastructure Master role does not work at all, and even in a multi-domain environment it is rarely used except when complex user administration tasks are performed. Because of this, the hardware requirements for machines holding this role are relatively small.

[phantom object]: When an object references another object, such as when a group references its member, and the referenced object is not in the directory database of the domain controller (because the two objects are in different domains), a special record called a phantom is needed in the directory database to represent the referenced object. A phantom contains two or three identifiers of the referenced object: the GUID, the distinguished name (DN), and if the referenced object is a security principal, a SID.

[review]:
- Group-to-user references updates
- domain-wide; only 1 in every domain
- Infrastructure Master should not be on the same DC as Global Catalog

[Combination of roles on a DC]:
- The PDC EMULATOR and the RID MASTER should be on THE SAME DC, if possible. 
- The SCHEMA MASTER and DOMAIN NAME MASTER should also be on the same DC. To provide fault tolerance, there should be at least 2 domain controllers available within each domain of the Forest. 
- The INFRASTRUCTURE MASTER ROLE holder SHOULD NOT also BE A GLOBAL CATALOG: If the IM Flexible Single Master Operation (FSMO) role holder is also a global catalog server, the phantom indexes are never created or updated on that domain controller. (The FSMO is also known as the operations master.) This behavior occurs because a global catalog server contains a partial replica of every object in Active Directory. The IM does not store phantom versions of the foreign objects because it already has a partial replica of the object in the local global catalog. 


-> FAILURE CONSEQUENCES


- Schema Master dropout
  - invisible for users
  - visible for administrator only when making schema changes
- Domain (Naming) Master dropout
  - invisible for users
  - visible for administrator only when adding or removing domains
- RID Master dropout
  - invisible for users
  - visible for administrator only when adding objects while the 
    assigned relative ID range is empty
- PDC Emulator dropout
  - even temporary dropouts are visible!
  - Infrastructure Master dropout
  - invisible for users
  - visible for administrator when transfering higher volume of accounts


#
# ACTIVE DIRECTORY BACKUP AND RESTORE
#


[review]:

preparation
  - backup device 
    - is connected and working, 
    - is in W2k3 HCL (Hardware Compatibility List), 
    - is inserted
  - operator is member of Administrators or Backup Operators groups

Windows Server 2003 system state data:
  - registry
  - COM+ Class Registration database
  - system boot files
  - files under Windows File Protection
  - Certificate Services database 
  - DC: Active Directory
  - DC: Sysvol Directory
... and:
  - impossible to choose only a subset
  - remote computers data cannot be backed up
  - Backup Or Restore Wizard  

Restore
  - NONAUTHORITATIVE RESTORE
    - restoration from media followed by standard replication
  - AUTHORITATIVE RESTORE
    - forced return to backed state

-> NONAUTHORITATIVE RESTORE
  - reboot, F8
  - Directory Services Restore Mode
  - login as SAM Administrator (not AD!) => Safe Mode
  - Backup Or Restore Wizard
  - reboot

-> AUTHORITATIVE RESTORE
  - perform Nonauthoritative Restore
  - after reboot use F8 to get into Safe Mode again
  - ntdsutil
    - write: authoritative restore
    - whole AD:  restore database
    - selected subtree:  restore subtree s_d_n
    - restore subtree OU=Security1,DC=Microsoft,DC=COM
    - overwrite the version: restore database verinc version_increase
    - write: quit
  - reboot, connect to the network, the standard replication starts

#
# GROUP POLICY
#


[review]:
- collection of user and computer configuration settings that specify how
  programs, network resources, and the operating system work for users and 
  computers in an organization. 
-  can be set up for computers, sites, domains, and OUs. 
- Group policy = groupings of policy settings
  - e.g. definition of programs available for the user, desktop shortcuts, 
    Start menu options
- NOTE: strongly consider changes in default Group policy


-> GPO (GROUP POLICY OBJECT)

- set of Group Policy Settings
- GPO is an _object_ => access rights and authority delegation applies 
  (GPO Security Tab)

- local vs. non-local GPO: 
  Local Group Policy objects are stored on individual computers. Only one 
  local Group Policy object exists on a computer, and it has a subset of 
  the settings that are available in a nonlocal Group Policy object. Local 
  Group Policy object settings can be overwritten by nonlocal settings if 
  they are in conflict; otherwise, both groups of settings apply. 

- Local GPO
  - on every computer, even if not part of the network
  - overriden by non-local GPOs
  - default  only Security Settings, the others are not defined
  - %Systemroot%\System32\GroupPolicy 

- Nonlocal GPO
  - created in AD, linked to site, domain, OU
  - Created by default:
    - Default Domain Policy  affects all users and computers in the domain 
      (including DCs)
    - Default Domain Controllers Policy  affects only DCs
      (they are in the Domain Controllers OU)
    - %Systemroot%\Sysvol\Domain Name\Policies\GPO GUID\Adm
    - GPO GUID: Replication Monitor, monitor DC, right click DC, Show GPO status

- GPO may set:
  - Computer Configuration settings
  - User Configuration settings
  -> Logon/Logout and Startup/Shutdown scripts  timeout 10 min !!
    - Don't use it for backups and other long operations

- GPO and Sites
  - GPO may be linked to a Site, the information is replicated to all DCs in 
    the site (and sites with site link). GPO is therefore applied to all DCs 
    in the site regardless on their domain and therefore may be applied to 
    more domains in the tree even it is stored in only one and therefore must 
    be read from there when used in remote domain => if child-domains are in
    different WANs, strongly consider GPO placement.

- Naming Objects
  - examples:
    LDAP distinguished name (DN)
     CN=Jack Brown, OU=Sales, DC=sanao, DC=com
     
    LDAP relative distinguished name (RDN)
     Jack Brown
     
    Common name (CN)
     Jack Brown
     
    Canonical name, two versions
     DC=com/DC=sanao/OU=Sales/CN=Jack Brown or sanao.com/Sales/Jack Brown
     
    User principal name (UPN)
     Jack.Brown@sanao.com
     
    Downlevel name (SAM name)
     SANAO\JackB
 
  - DISTINGUISHED NAME (DN). Because every object resides in an OU tree, which 
    in turn resides in a domain tree, a distinguished name specifies the path to 
    the object in both trees. CN=Jack Brown, OU=Sales specifies the object's 
    name and location inside one domain's OU tree, and DC=sanao, DC=com 
    identifies the domain. Each component of the name has a naming attribute 
    prefix. CN stands for common name, OU for organizational unit, and DC for 
    domain component. There are also the prefixes C (country), O (organization),
     and L (locality), but they are usually not used in Active Directory.
  - RELATIVE DISTINGUISHED NAME (RDN). This is the first component (i.e., the 
    "least significant") of the distinguished name, and it must be unique among 
    its sibling objects (i.e., objects in the same container). In other words, 
    the RDN is the name of an object in its parent container. The RDN of a user,
    group, computer, and almost all other objects is the same as its common 
    name. The RDN of an OU is the same as its OU attribute, and the RDN of a 
    domain is the same as its DC attribute. CN, OU, and DC are also called 
    naming attributes. Our example in Table 1.3 shows just Jack Brown, but with 
    some utilities, you may need to include the prefix, such as CN=Jack Brown.

    - Common RDNs:
      - DC       domainComponent
      - CN       commonName
      - OU       organizationalUnitName
      - UID      userid
  




#
# Document resources
#

-  Inside Active Directory 2nd Edition (book) 

->  Links:

o  http://en.wikipedia.org/wiki/Active_Directory
o  http://cs.wikipedia.org/wiki/Active_Directory
o  http://technet.microsoft.com/en-us/library/cc780036(WS.10).aspx#w2k3tr_ad_over_qbjd


