Adprep
Applies To: Windows Server 2003, Windows Server 2008, Windows Server 2003 R2, Windows Server 2012, Windows Server 2003 with SP1, Windows 8
Extends the Active Directory® schema and updates permissions as necessary to prepare a forest and domain for a domain controller that runs the Windows Server® 2008 operating system.
Adprep.exe is a command-line tool that is available on the Windows ServerВ 2008 installation disc in the \sources\adprep folder, and it is available on the Windows ServerВ 2008В R2 installation disk in the \support\adprep folder. You must run adprep from an elevated command prompt. To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.
In Windows ServerВ 2008В R2, Adprep is available in a 32-bit version and a 64-bit version. The 64-bit version runs by default. If you need to run Adprep on a 32-bit computer, run the 32-bit version (Adprep32.exe).
For more information about running Adprep.exe and how to resolve errors that can occur when you run it, see Running Adprep.exe ( HYPERLINK «https://go.microsoft.com/fwlink/?LinkID=142597» https://go.microsoft.com/fwlink/?LinkID=142597).
For examples of how this command can be used, see Examples.
For more information about running adprep /forestprep, see Prepare a WindowsВ 2000 or WindowsВ ServerВ 2003 Forest Schema for a Domain Controller That Runs WindowsВ ServerВ 2008 or WindowsВ ServerВ 2008В R2 (https://go.microsoft.com/fwlink/?LinkID=93242).
For more information about running adprep /domainprep /gpprep, see Prepare a WindowsВ 2000 or WindowsВ ServerВ 2003 Domain for a Domain Controller That Runs WindowsВ ServerВ 2008 or WindowsВ ServerВ 2008В R2 (https://go.microsoft.com/fwlink/?LinkID=93243).
For more information about running adprep /rodcprep, see Prepare a Forest for a Read-Only Domain Controller (https://go.microsoft.com/fwlink/?LinkID=93244).
Syntax
Parameters
Prepares a forest for the introduction of a domain controller that runs Windows ServerВ 2008. You run this command only once in the forest. You must run this command on the domain controller that holds the schema operations master role (also known as flexible single master operations or FSMO) for the forest. You must be a member of all the following groups to run this command:
The Enterprise Admins group
The Schema Admins group
The Domain Admins group of the domain that hosts the schema master
Prepares a domain for the introduction of a domain controller that runs Windows ServerВ 2008. You run this command after the forestprep command finishes and after the changes replicate to all the domain controllers in the forest.
Run this command in each domain where you plan to add a domain controller that runs Windows ServerВ 2008. You must run this command on the domain controller that holds the infrastructure operations master role for the domain. You must be a member of the Domain Admins group to run this command.
Performs similar updates as domainprep. However, this command also provides updates that are necessary to enable Resultant Set of Policy (RSOP) Planning Mode functionality.
In Active Directory environments that run Microsoft Windows® 2000, this command performs updates during off-peak hours. This minimizes replication traffic that is created in those environments by updates to file system permissions and Active Directory permissions on existing Group Policy objects (GPOs). This command is also available on Microsoft Windows Server 2003 with Service Pack 1 (SP1) or later.
Run this command after the forestprep command finishes and after the changes replicate to all domain controllers in the forest. You must run this command on the infrastructure master for the domain. For more information about running this command in WindowsВ 2000 Active Directory environments, see Prepare Your Infrastructure for Upgrade (https://go.microsoft.com/fwlink/?LinkId=94798).
Updates permissions on application directory partitions to enable replication of the partitions to read-only domain controllers (RODCs). This operation runs remotely; it contacts the infrastructure master in each domain to update the permissions. You need to run this command only once in the forest. However, you can rerun this command any time if it fails to complete successfully because an infrastructure master is not available. You can run this command on any computer in the forest. You must be a member of the Enterprise Admins group to run this command.
Returns an expanded set of exit codes, instead of just 0 (Success) and 1 (Failure).
Specifies that no standard output is returned from an operation. This parameter can be used only if /wssg is also used.
Returns to the prior menu.
Displays Help for this command.
Displays Help for this command.
Remarks
To prepare an existing WindowsВ 2000 or Windows ServerВ 2003 Active Directory environment for a Windows ServerВ 2008 domain controller, be sure to run the version of Adprep that is included in the Windows ServerВ 2008 installation media.
If you run Adprep on a domain controller running WindowsВ 2000 Server, the domain controller must be running WindowsВ 2000 Server Service PackВ 4 (SP4) or later.
You can also perform verification steps before and after you run the adprep command to help ensure that the operations complete successfully. For more information, see Steps for Extending the Schema (https://go.microsoft.com/fwlink/?LinkId=94799).
Exit Codes
The following table lists exit codes that Adprep can return after an operation completes.
Как мигрировать контроллер домена с системы Server 2003 на 2008
Для того, чтобы мигрировать контроллер домена на базе Windows Server 2003 R2 Enterpise на систему Windows Server 2008 R2 Enterprise и пойдет речь в данно й заметке.
Это делается для того, чтобы научиться управлять всеми возможностями новой среды, стать так сказать более продуктивнее. Многие заметки на моем блоге — это действительно показывают, причем наглядно и это не пустые слова, об этом говорит статистика их просмотров. Но довольно лирики, перейду к пошаговым шагам которые я изложу в этой заметке.
Контроллер домена развернутый ранее ( Windows Server 2003 R2)
и система Windows Server 2008 R2 ( заострять внимание как развернуть данную систему смысла не вижу, у меня UAC отключен) в той же подсети.
И так у меня есть существующий домен, polygon.local. Сетевые настройки точно такие же, как и в моей предыдущей заметке, которая по сути и является основной, а текущая ее продолжением.
Выделю основную цель: — развернуть контроллер домена на новой операционной системе, а предшествующий контроллер домена освободить от занимаемых функций, в пользу нового.
Проверим на dc1.polygon.local – кто же является обладателем всех FSMO— ролей.
FSMO – роли бывают:
Роль PDC Emulator – консоль Active Directory – Users and Computers
Роль RID Master – консоль Active Directory – Users and Computers ( Хозяин относительных идентификаторов)
Роль Infrastructure Master – консоль Active Directory – консоль Users and Computers ( Хозяин инфраструктуры )
Роль Domain Naming Master – консоль Active Directory – Domains and Trusts ( Хозяин именования доменов)
Роль Schema Master ( Хозяин схемы) — специальная консоль. Которая содержит оснастку Active Directory Schema ( Схема Active Directory)
Win + R → cmd.exe → вызываем утилиту netdom ( но есть одно, но данная утилита по умолчанию не установлена в системе, для ее установки потребуется пакет Support Tools, обычно он идет в комплекте с дистрибутивом, в данный пакет также входять такие необходимые подготовительные утилиты, как:
dcdiag – средство для диагностики контроллера домена на работоспособность с целью исправить все обнаруженные ошибки (запуск ее перед миграцией очень важен)
C:\Documents and Settings\Administrator>netdom query fsmo
Schema owner dc1.polygon.local
Domain role owner dc1.polygon.local
PDC role dc1.polygon.local
RID pool manager dc1.polygon.local
Infrastructure owner dc1.polygon.local
The command completed successfully.
, как видно все FSMO роли принадлежат контроллеру домена dc1.
Далее установленную систему Windows Server 2008 R2 Enterprise с именем dc2 вводим в домен, предварительно предопределив статический IP адрес, к примеру: 10.9.9.2
dc2: Win + R → cmd.exe →
C:\Users\Administrator>netsh interface show interface
Admin State State Type Interface Name
Enabled Connected Dedicated Local Area Connection
C:\Users\Administrator>netsh interface ipv4 set address «Local Area Connection» static 10.9.9.2 255.255.255.0
C:\Users\Administrator>netsh interface ipv4 set dns name=»Local Area Connection» static 10.9.9.1 primary
C:\Users\Administrator>netdom join %computername% /domain:polygon.local /userd:polygon.local\ekzorchik /passwordd:*
Type the password associated with the domain user:
The computer needs to be restarted in order to complete the operation.
The command completed successfully.
Перезагружаем систему, чтобы применились изменения и система стала полноправным членом домена : C:\Users\Administrator>shutdown /r /t 3
Следующий этап: — это обновление домена и леса , для этого нужно из установочного диска Windows Server 2008 R2 подмонтированного на логический диск D: — скопировать полностью папку (« adrep”) и переместить ее на домен контроллер dc1:
Win + R → cmd.exe
C:\Users\Administrator>hostname
C:\Users\Administrator>mkdir \\dc1\c$\support
C:\Users\Administrator>copy d:\support\adprep \\dc1\c$\support
44 file(s) copied.
На заметку: Если система dc1 у Вас 32— х битная то запускать следует исполняемый файл adprep32.exe, а если 64- х битная то adprep.exe
У меня dc1 – 64-х битный, поэтому и запускаем файл adprep.exe с ключами forestprep ( как держатель мастер схемы) и после domainprep ( как держателе инфраструктуры). Порой в небольшой организации (к примеру в которой я сейчас работаю) все эти роли обычно имеют место быть на одном из том же контроллере домена:
На заметку: при подготовке леса необходимо войти в мастер схемы в качестве члена группы Администраторов для схемы, предприятия и домена.
C:\Documents and Settings\Administrator>cd /d c:\
C:\>hostname
C:\>cd support
C:\support>adprep.exe /forestprep
если ничего не происходит, значит делаем по другому, а именно монтируем iso Образ дистрибутива Windows Server 2008 R2 к системе Windows Server 2003 R2 на логический диск D:
и через вызов командной строки: Win + R → cmd.exe
C:\>d:\support\adprep\adprep.exe /forestprep
Before running adprep, all Windows 2000 Active Directory Domain Controllers in t
he forest should be upgraded to Windows 2000 Service Pack 4 (SP4) or later.
If ALL your existing Windows 2000 Active Directory Domain Controllers meet this
requirement, type C and then press ENTER to continue. Otherwise, type any other
key and press ENTER to quit.
C — на предупреждение вводим « C” и нажимаем Enter, чтобы начать подготовку леса. ( процесс отрабатывает довольно долго)
Opened Connection to DC1
SSPI Bind succeeded
Current Schema Version is 31
Upgrading schema to version 47
Connecting to «DC1»
Logging in as current user using SSPI
Importing directory from file «C:\WINDOWS\system32\sch32.ldf»
18 entries modified successfully.
И много всякой успешной информации которую я не буду здесь приводить.
Adprep successfully updated the forest-wide information.
Результирующим завершения команды должна быть надпись : Adprep successfully updated the forest-wide information.
После этого вводим команду:
C:\>d:\support\adprep\adprep.exe /domainprep /gpprep
Adprep detected that the domain is not in native mode
Adprep has stopped without making changes.
Configure the domain to run in native mode and re-run domainprep
поправить данное не выполнение команды можно так:
Start – Control Panel – Administrative Tools – Active Directory Users and Computers
выделяем домен polygon.local и через правый клик изменяем режим работы домена:
polygon.local – Raise Domain Functional Level
Привести к виду: выбрав вместо Windows 2000 native → Windows Server 2003 и нажать Raise ( Изменить)
и после подтвердить нажав OK
(Перевод: Это изменение затрагивает весь домен. После повышения режима работы домена его невозможно отменить.)
После будет информативное окно, что:
(Перевод: Режим работы успешно повышен. Новый режим работы будет реплицирован на каждый контроллер домена в домене. Время, которое на это потребуется, зависит от топологии репликации.)
После этого снова запускаем командную строку и набираем:
C:\>d:\support\adprep\adprep.exe /domainprep /gpprep
Adprep successfully updated the domain-wide information.
Adprep successfully updated the Group Policy Object (GPO) information.
Далее разрешим обновление контроллеров домена с доступом только для чтения.
C:\>d:\support\adprep\adprep.exe /rodcprep
Вот основные шаги по обновления схемы завершены, приступим к повышению роли нового сервера ( dc2) до контроллера домена.
На сервере Dc2: логинимся под доменной учетной запись обладающей правами « Domain Adminis”, в моем случае это учетная запись ekzorchik и вызываем утилиту dcpromo: Win +R > dcpromo
ставим галочку: Use advanced mode installation – Next – Next – Existing forest – Add a domain controller to an existing domain ( добавить домен контроллер в существующий домен) — Next – проверяем настройки аутентификации: (должно быть так как указано на скриншоте ниже)
и нажимаем Next – выбираем домен polygon.local (forest root domain) – Next – выбираем текущий сайт (у меня он один) Default-First-Site-Name – Next – активируем установку ( Ставим галки) следующих опций на вводимом в эксплуатацию контроллере домена, таких как:
Далее соглашаемся Yes – отмечаем пункт Replicate data over the network from an existing domain controller – Next – отмечаем пункт Use this specific and appropriate domain controller ( выделяем dc1.polygon.local) – Next – местонахождение каталогов NTDS (Database), NTDS (Log), SYSVOL оставляем дефолтным — Next – задаем пароль для Административной учетной записи на случай восстановления: — я указываю 712mbddr@ — Next – Next – начнется процесс преобразования
и ставим в этом процессе галочку « Reboot on completion” — перезагрузить систему ( dc2) когда процесс становления контроллера домена завершится успешно, дабы активировать изменения.
Теперь у меня есть два контроллера домена, работающих одновременно.
Дальше нужно передать роли FSMO с dc1 на dc2, сделать это можно двумя различными способами:
- Первый способ: через графический интерфейс
- Второй способ: через консольную утилиту ntdsutil.exe
У меня уже есть совмещенная заметка где описаны оба способа: ( см заметку: http://www.ekzorchik.ru/2012/09/server-2008-fsmo-roles-move/ )
Если же Вам нужно удалить неисправный контроллер домена (см. заметку:
Вот собственно и все, с чем я хотел познакомить читателей моего блога, но и про себя не забыл подробным руководством, что и как сделать. Данный процесс я проводил в одной организации в которой имел место работать. Если у меня будут какие либо неполадки в следствии этой миграции то они обязательно лягут в основу расписанных заметок. До встречи, с уважением автор блога ekzorchik.