win2008 ad domain controller structures

I. Introduction

1.1 AD Domain Services

What is a directory (directory) do?

In the phone book used in everyday life recorded name, phone and address data such as friends and family, it is the telephone directory (telephone directory); recorded in a computer file in the file system (file system) of the file name, size and date and other data, it is the file directory (file directory).

If the data in these directories can be organize by the system, the user can easily and quickly find the required data, and service directory service (directory service) provides, it is to achieve this purpose. In real life, directory assistance is also a directory; on the Internet, Baidu and Google search function is also provided a directory service.

Components directory database (the database directory) Active Directory domain is used to store user accounts, computer accounts, printers, and shared folders and other objects, and provide directory service is Active Directory (AD) domain services (Active Directory Domain Service, AD DS), which is responsible for storing the directory database, add, delete, modify and query and other operations. Generally applicable to a LAN.

In AD Domain Services (AD DS), AD is a namespace (Namespace). The use of AD, we can find all the information related to the object by object name.

Using the Domain Name System (DNS) in TCP / IP network environment to resolve the mappings between host names and IP addresses, that is, the use of DNS to resolve to get the IP address of the host. In addition, AD Domain Services is also closely integrated with DNS together, it also uses DNS domain namespace architecture, domain name using DNS format, such as domain name AD domain can be named moonxy.com.

1.2 AD domain object attribute

AD domain resources to the object (Object) in the form of, for example, a user, such as a printer and a computer are objects, and the object is to be characterized by attributes (Attriburte), that is to say the object itself is a collection of attributes. For example, Joe Smith create an account, you must add an object type (object class) for the user object (that is, user accounts), and then enter the name of Joe Smith in the user account, login account, phone number and e-mail information, which the user account is the object, and the names, logins and other data that is the object's properties, Joe Smith is the object type for the user (user) objects.

DC 1.3 AD Domain Controller

In AD Service Domain (AD DS) directory data storage domain controller (Domain Controller, DC) inside. A domain can have more than one domain controller, each domain controller position is almost equal to their respective stores an almost identical Active Directory. When you add a user account in any domain controller later, this account is created in the default domain controller's Active Directory, then automatically be copied (replicate) to other Active Directory domain controller, so that all Active Directory domain controllers within the data can be synchronized (synchronize).

When a user logs on a computer domain, which will be made based on a domain controller in its account data in Active Directory, to review the user to enter account and password are correct. If it is correct, the user can log on successfully; on the contrary, will be denied login. A domain controller is a server-level amounts computer to play, for example, Windows Server 2012 and Windows Server 2008 R2 and so on.

Typically, the domain controller Active Directory database can be read or written, in addition, there is Active Directory database may be read only, read-only domain can not be modified controller (Read-Only Domain Controller, RODC ). For example, a subsidiary located in a remote network, if security measures are not as complete as the head office, you can use the RODC.

1.4 LDAP

LDAP (Lightweight Directory Access Protocol), Lightweight Directory Access Protocol, is a method used to update the query Active Directory directory service communication protocol. AD domain name service using LDAP path (LDAP naming path) to indicate the position of an object within the AD, so use it to access the object in the AD.

LDAP organization's data:

LDAP path name as follows:

Identification name (the Name Distinguished, the DN) : It is the full path to the object in the Active Directory, the DN  has three properties, namely  the CN, the OU, the DC .

DC (Domain Component): Domain component;

CN (Common Name): generic name, usually a user name or computer name;

OU (Organizational Unit): organizational units;

For example, as a user account, which DN is:

CN = John Doe, OU = the Web front end group, OU = software development, DC = moonxy, DC = com

其中 DC(Domain Component)表示 DNS 域名中的组件,例如 moonxy.com 中的 moonxy 与 com;OU为组织单位(Organization Unit)CN为通用名称(Common Name),一般为用户名或服务器名。除了DC与OU之外,其他都利用CN来表示,例如用户与计算机对象都属于CN。上述DN表示法中的 moonxy.com 为域名,软件研发部、Web前端组都是组织单位。此 DN 表示账户张三存储在 moonxy.com\软件研发部\Web前端组路径中。

相对标识名称(Relative Distinguished Name,RDN):RDN用来代表DN完整路径中的部分路径,例如上面路径中的 CN=张三与 OU=Web前端组等都是 RDN。

Base DN:LDAP 目录树的最顶部就是根,也就是所谓的 "Base DN",如 "DC=moonxy,DC=com"。

除了 DN 与 RDN 这两个对象名称外,另外还有如下两个名称:

全局唯一标识符(Global Unique Identifier,GUID):GUID 是一个128位的数值,系统会自动为每个对象指定一个唯一的GUID。虽然可以改变对象的名称,但是其GUID永远不会改变。

用户主体名称(User Principal Name,UPN):每个用户还可以有一个比DN更短、更容易记忆的 UPN,例如上面的张三隶属于 moonxy.com,则其 UPN 可以为 [email protected]。用户登录时所输入的账户名最好是 UPN,因为无论此用户的账户被移动到哪一个域,其 UPN 都不会改变,因此用户可以一直使用同一个名称来登录。

AD 与 LDAP 的关系:LDAP 是一种用来访问 AD 数据库的目录服务协议,AD DS 会通过 LDAP 名称路径来表示对象在 AD 数据库中的位置,以便用它来访问 AD 数据库内的对象。LDAP 的名称路径包括有 DN、RDN。

openLDAP(Linux),Active Directory(Microsoft)等是对 LDAP 目录访问协议的具体实现,除了实现协议的功能,还对它进行了扩展。

1.5 全局编录

虽然在域树内的所有域共享一个 Active Directory,但是 Active Directory 数据却分散在各个域内,而每个域仅存储该域本身的数据。因此,为了让用户、应用程序能够快速找到位于其他域内的资源,在 AD 域服务器内设计了全局编录(Global Catalog,GC)

全局编录的数据存储在域控制器内,这台域控制器被称为全局编录服务器,它存储着林内所有域的 AD 内的每个对象。不过只存储对象的部分属性,这些属性都是常用来搜索的属性,例如用户的电话号码、登录账户名等。全局编录让用户即使不知道对象位于哪一个域内,仍然可以快速的找到所需的对象。

用户登录时,全局编录服务器还负责提供该用户所属的通用组的信息;用户利用 UPN 登录时,它会负责提供该用户隶属于哪一个域的信息。

一个林内的所有域树共享相同的全局编录,而林内的第一台域控制器默认就是全局编录服务器。必要时,也可以另外指派其他域控制器来当做全局编录服务器。

二、安装 DNS 和 AD 域服务

Windows 版本:Windows Server 2008 Enterprise Service Pack 1

系统类型: 64 位操作系统

2.1 安装 DNS 服务器

这一步不是必须的,在安装 Active Directory 域服务时可以同时装上 DNS 服务器:Active Directory 域服务安装向导 -> 其它域控制服务器,勾上 DNS 服务器也有同样效果。但是鉴于服务器配置容易出现一些未知错误,所以还是推荐提前安装 DNS 服务比较好。

首先应该配置 DNS 服务器的静态 IP(推荐),否则安装时会出现如下提示:

并且 DNS 服务器的地址设置为自己的地址 127.0.0.1:

开始菜单 -> 管理工具 -> 服务器管理器,或者直接点击开始菜单旁边的快捷图标:

选择左侧树形菜单 "角色" 节点,右键 "添加角色",此处的 "角色" 表示此服务器要被配置为什么功能的服务器,即提供什么样的服务:

 进入 "添加角色向导",点击 "下一步" 按钮:

进入选择 "角色" 页面:

勾选 "DNS 服务器" 角色,并点击 "下一步" 按钮:

进入 DNS 服务器简介页面,点击 "下一步" 按钮:

进入确认安装页面,点击 "安装" 按钮:

出现如下进度条:

点击 "关闭" 按钮,并重启服务器:

此时,DNS 服务已经安装完成。

2.2 安装 Active Directory 域服务

进入 "服务器管理器" 中添加 AD 域服务角色:

或者点击开始菜单 -> 运行 -> 输入命令 "dcpromo" ,然后回车:

备注:

dcpromo 命令是一个 "开关" 命令。如果 Windows Server  2008 计算机是成员服务器,则 运行 dcpromo 命令会安装 AD 活动目录,将其升级为域控制器;如果Windows Server 2008 计算机已经是域控制器,则运行 dcpromo 命令会卸载 AD 活动目录,将其降级为成员服务器。

进入安装界面界面:

弹出 Active Direcotry 域服务安装向导,点击 "下一步" 按钮:

进入兼容性提醒页面,不用理会,点击 "下一步" 按钮:

注意:如果是第一次搭建也是你整个内网中的第一台域控制器,那么需要选择第二项 "在新林中新建域",第一项是内网中已经存在 AD 环境再想搭建额外域控制器的时候使用的。

选择 "在新林中新建域”并点击",点击 "下一步" 按钮:

输入域名,这个要慎重,因为这个配置完毕之后要修改很麻烦且有风险,并点击 "下一步" 按钮:

进入林功能级别设置界面,选择 "Windows Server 2008",然后点击 "下一步":

注意:

这里需要强调的是,如果你的 AD 中以后可能会出现 Windows Server 2003 系统的域控制器,请务必选择 Windows Server 2003 的域功能级别,要不以后那些 Windows Server 2003 的服务器就做不了域控制器了,所以安装第一台 DC 的时候,都选择的低级别的林功能,以后要升到 Windows Server 2008 的域功能级别是没问题的,若是选了 Windows Server 2008 的功能级别,以后要降级就难了。

点击 "下一步" 按钮:

如果最初没有安装 DNS 服务器,此处可以勾选并安装:

如果已经安装,此处即为灰色:

弹出 DNS 提示框,不用理会,点击 "是" 按钮,继续安装:

进入AD 域的数据库文件、日志文件和共享文件位置设置页面,此处保持默认设置,点击 "下一步" 按钮:

进入 "域还原密码" 设置界面,此密码相当的重要,后续做数据库迁移、备份、整理、恢复的时候都可能用到,务必要牢记:

 填入密码之后,点击 "下一步" 按钮:

进入 "摘要" 界面,显示之前设置的摘要信息,点击 "下一步" 按钮:

此处可以点击 "导出设置" 到一个位置保持起来,以便后续排错时查阅,也可以作为 DC 安装时的无人值守安装的脚本。

安装向导进入配置过程

点击 "完成" 按钮,重启服务器:

此时,AD  域服务已经安装完成。ADDS域控制器已经安装完成,在完成域控制器的安装后,系统会自动的将该服务器的用户账号转移到 AD 数据库中。

2.3 检查 DC 是否已经注册到 DNS

域控制器 DC 会将自己扮演的角色注册到 DNS 服务器内,以便让其他计算机能够通过 DNS 服务器来找到这台域控制器,因此先检查 DNS 服务器内是否已经存在这些记录。利用与系统管理员(MOONXY/Administrator)登录。

检查主机记录

首先检查域控制器是否已经将其主机名与 IP 地址注册到 DNS 服务器内。请到扮演 DNS 服务器角色的计算机 WIN-NHLP41A04F6.moonxy.com 上点击 "DNS" 菜单:

此处应该会有一个名称为 moonxy.com 的区域,图中的主机(A)记录表示域控制器 WIN-NHLP41A04F6.moonxy.com 已经正确地将其主机名与 IP 地址注册到 DNS 服务器内。DNS 客户端所提出的请求大多是正向解析,即通过 hostname 来解析 IP 地址对应与此处的正向查找区域;通过 IP 来查找 hostname 即为反向解析,对应于此处的反向查找区域。

如果域控制器已经正确地将其扮演的角色注册到 DNS 服务器,则还应该有对应的 _tcp、_udp 等文件夹。在单击 _tcp 文件夹后可以看到如下所示的界面,其中数据类型为服务位置(SRV)的 _ldap 记录,表示 WIN-NHLP41A04F6.moonxy.com 已经正确地注册为域控制器。其中的 _gc 记录还可以看出全局编录服务器的角色也是由 WIN-NHLP41A04F6.moonxy.com 扮演的。

DNS 区域内包含这些数据后,其他要加入域的计算机就可以通过通过此区域来得知域控制器为 WIN-NHLP41A04F6.moonxy.com。这些加入域的成员(域控制器、成员服务器、Windows 8、Windows 7、Windows Vista、Windows XP Professional 等)也会将其主机与 IP 地址数据注册到此区域内。

三、管理 AD 域用户账户

3.1 域用户管理工具

可以使用如下两个工具来管理域账户,如下:

Active Directory 用户和计算机:这是之前 Windows Server 2008、Windows Server 2003 等系统就已经提供的工具;

Active Directory 管理中心:这是从 Windows Server 2008 R2 开始提供的工具,用来取代 Active Directory 用户和计算机。

3.2 创建组织单位与域用户账户

通过使用 Active Directory 用户和计算机进行说明:

可以将用户账户创建到任何一个容器或组织单位(OU)内。以下创建一个名为软件研发部的组织单位。然后再建子组织单位,最后在此子组织单位内创建域用户账户。

创建组织单位:

输入软件研发部的组织单位,然后点击 "确定" 按钮:

创建之后,在该组织下面继续创建两个子组织单位:Web 前端组和 Java 开发组

Web 前端组:

Java开发组:

创建用户:

进入创建用户界面,填入用户信息,比如此处创建用户:张三,然后点击 "下一步" 按钮:

注意:

用户 UPN 登录:用户可以利用这个与电子邮箱格式相同的名称([email protected])来登录域,此名称被称为 User Principal Name(UPN)。在整个林内,此名称必须是唯一的。

用户 SamAccountName 登录:用户也可以利用此名称(MOONXY\zhangsan)来登录域,其中 MOONXY 为 NetBIOS 域名。同一个域内,此登录名称必须是唯一的。Windows NT、Windows 98 等旧版系统并不支持 UPN,因此在这些计算机上登录时,只能使用此处的登录名。

进入创建密码界面,域用户的密码默认必须至少7个字符,且至少包含大写字母、小写字母、数字、非字母数字等4组中的3组,点击 "下一步" 按钮:

进入完成页面:

 点击上面的 "完成" 按钮,即可看到新增的用户:张三

同理,在 "Web 前端组" 子组织单位下继续创建用户:李四,在 "Java开发组" 组组织机构下创建两个用户:王五、赵六。结果如下:

Web 前端组用户:

Java 开发组用户:

创建好上面的域用户账户之后,就可以用来测试登录域的操作。直接到域内任何一台非域控制器的计算机上登录域,例如 Windows Server 2012 成员服务器或已加入域的 Windows 8 计算机。一般用户账户默认无法在域控制器上登录,除非另外开放。

Guess you like

Origin www.cnblogs.com/tankblog/p/11241777.html