活动目录学习笔记

  • 格式:doc
  • 大小:155.00 KB
  • 文档页数:9

下载文档原格式

  / 9
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

关于活动目录的学习笔记

一、活动目录的结构。AD主要包括数据库和SYSVOL共享;如下:

1、数据库。基于扩展存储引擎(ese)的数据库,类似Exchange。默认在%systemroot%NTDS目录下,主要包括的文件有:ntds.dit-数据库文件、edb.chk-检查点文件(checkpoint)、edb*.log-日志文件、res1.log和res2.log-保留日志文件(这两个文件各占用10M磁盘空间,当磁盘空间不足时释放出来供AD使用)。

这个ESE引擎是微软专门为保存非关系型数据而开发的,在微软的很多系统中都有应用:例如,AD的数据库(ntds.dit文件)、Exchange的数据库(*.edb和*.stm),还有Windows DHCP、Windows WINS、SRS等,后台都是由ESE数据库来提供支持的。

2、SYSVOL共享。Domain文件夹存放域级别策略与脚本。具体的policies中存放策略,scripts中存放脚本。Enterprise文件夹存放企业级别策略与脚本。具体的policies 中存放策略,scripts中存放脚本。Staging Areas文件夹是交换区域,多台DC之间的信息交换的缓存区域;本身是空的,挂接到Staging文件夹。sysvol文件夹是客户端真正访问的区域,本身是空的,挂接到Domain文件夹。

二、创建活动目录。

命令:Dcpromo;

安装:1、新域新树新森林;2、已有域的附加DC;3、已有域树的新的子域;4、新的域树;

或删除、降级DC。

安装注意事项:

活动目录恢复模式(DSRM)密码;

AD存储位置;数据库、日志和SYSVOL共享文件夹的存储位置,存储在相同/不同的卷或物理磁盘,要考虑磁盘I/O性能、DC角色、荷载等。

三、操作主控(Operation Master Roles或FSMO)和全局编录(GC)。

五种操作主控:

构架主控(Schema Master)注册:regsvr32 schmmgmt.dll

域命名主控(Domain Naming Master)

PDC仿真器(PDC Emulator)

RID主控(RID Master)

基础架构主控(Infrastructure Master)。

操作主控的查询:

命令行——netdom query FSMO

GUI下,查询构架主控——Active Directory® 架构

查询域命名主控(Domain Naming Master)Active Directory®域和信任关系

查询PDC仿真器(PDC Emulator)Active Directory®域和信任关系

查询RID主控(RID Master) Active Directory®域和信任关系

查询基础架构主控(Infrastructure Master)Active Directory®域和信任关系

操作主控的迁移和抢夺:ntdsutil。后面数据库部分详细讲。能够转移尽量不要抢夺。

FSMO&GC最佳实践:

构架主控(Schema Master)、域命名主控(Domain Naming Master)放在森林的首台DC上;PDC仿真器(PDC Emulator)、RID主控(RID Master) 放在各自域的首台DC上;基础架构主控(Infrastructure Master)放在域的首台DC之外的其他DC 上.。

GC原则上要和构架主控(Schema Master)放在同一台DC上;不要和基础架构主控(Infrastructure Master)放在同一台DC上。

对于GC主要标志是TCP3268/3269 Port的监听。

命令查询:nltest /dsgetdc <域名>

四、数据库

数据库的操作:ntdsutil、esentutl(类似eseutil)、ADSI Edit。

Ntdsuti的常用功能:1、Authoritative restore--权威恢复(增加修订号);2、Metadata cleanup--清除元数据(清除离线的、无法修复的DC的数据);3、Roles--操作主控的迁移和抢夺;4、files--数据库文件和日志文件的迁移、数据库碎片整理。

Ntdsutil使用实例——清除元数据(用于DC离线和重新安装DC):

At the command line, type ntdsutil and press ENTER.

At the ntdsutil: prompt, type metadata cleanup and press ENTER.

At the metadata cleanup: prompt, type connections and press ENTER.

At the server connections: prompt, type connect to server servername, where servername is

the domain controller (any functional domain controller in the same domain) from which you plan to clean up the metadata of the failed domain controller. Press ENTER.

Type quit and press ENTER to return you to the metadata cleanup: prompt.

Type select operation target and press ENTER.

Type list domains and press ENTER. This lists all domains in the forest with a number associated with each.

Type select domain number, where number is the number corresponding to the domain in which the failed server was located. Press ENTER.

Type list sites and press ENTER.

Type select site number, where number refers to the number of the site in which the domain controller was a member. Press ENTER.

Type list servers in site and press ENTER. This will list all servers in that site with a corresponding number.

Type select server number and press ENTER, where number refers to the domain controller to be removed.

Type quit and press ENTER. The Metadata cleanup menu is displayed.

Type remove selected server and press ENTER.

At this point, Active Directory confirms that the domain controller was removed successfully. If you receive an error that the object could not be found, Active Directory might have already removed from the domain controller.

Type quit, and press ENTER until you return to the command prompt.

Ntdsutil使用实例——迁移/抢夺操作主控(用于DC离线和重新安装DC):

At the command line, type ntdsutil and press ENTER.

At the ntdsutil: prompt, type roles and press ENTER.

At the metadata cleanup: prompt, type connections and press ENTER.

At the server connections: prompt, type connect to server servername, where servername is the domain controller (any functional domain controller in the same domain) from which you plan to clean up the metadata of the failed domain controller. Press ENTER.

Type quit and press ENTER to return you to the metadata cleanup: prompt

transfer pdc or seize pdc

rid master

infrastructure master

schema master

domain naming master

quit

Authoritative restore(权威恢复)和files(数据库文件、日志文件的迁移(移动到更新、更大的磁盘)和数据库的碎片整理)一般要进入活动目录恢复模式(DSRM)。

Esentutl 类似Exchange中的eseutil,可以对数据库进行底层操作。

察看数据库的空闲空间(Offline)

命令:esentutl /ms c:\windows\ntds\ntds.dit

数据库处于dirty shutdown状态时,用于重演日志,将数据库变成clean shutdown状态

命令:esentutl /r

离线压缩、碎片整理,Ntdsuti——files中的响应功能是对这个命令的调用。