步骤如下:
1. 遵循https://support.microsoft.com/kb/255504中的transfer FSMO的步骤.
2. 这样做之后还没完. 因为Windows Server 2012有点特殊, 如果你这时shut down掉老的PDC. 你会发现你的新PDC还是会尝试contact 老的PDC, 然后报错.
3. 看一下新的PDC的event viewer, 你会发现如下的警告(Warning):
This server is the owner of the following FSMO role, but does not consider it valid. For the partition which contains the FSMO, this server has not replicated successfully with any of its partners since this server has been restarted. Replication errors are preventing validation of this role.
Operations which require contacting a FSMO operation master will fail until this condition is corrected.
FSMO Role: DC=OldPDC,DC=local
User Action:
1. Initial synchronization is the first early replications done by a system as it is starting. A failure to initially synchronize may explain why a FSMO role cannot be validated. This process is explained in KB article 305476.
2. This server has one or more replication partners, and replication is failing for all of these partners. Use the command repadmin /showrepl to display the replication errors. Correct the error in question. For example there maybe problems with IP connectivity, DNS name resolution, or security authentication that are preventing successful replication.
3. In the rare event that all replication partners being down is an expected occurance, perhaps because of maintenance or a disaster recovery, you can force the role to be validated. This can be done by using NTDSUTIL.EXE to seize the role to the same server. This may be done using the steps provided in KB articles 255504 and 324801 on http://support.microsoft.com.
The following operations may be impacted:
Schema: You will no longer be able to modify the schema for this forest.
Domain Naming: You will no longer be able to add or remove domains from this forest.
PDC: You will no longer be able to perform primary domain controller operations, such as Group Policy updates and password resets for non-Active Directory Domain Services accounts.
RID: You will not be able to allocation new security identifiers for new user accounts, computer accounts or security groups.
Infrastructure: Cross-domain name references, such as universal group memberships, will not be updated properly if their target object is moved or renamed.
4. 遵循http://support.microsoft.com/kb/305476中的步骤, 修复此问题.
4. 下一步, 遵循http://technet.microsoft.com/en-us/library/jj574104.aspx中的步骤, 将老的PDC demote掉.
Powershell
==================================
Windows 2012上迁移这些FSMO roles非常方便了, 一个PowerShell命令搞定.
Move-ADDirectoryServerOperationMasterRole -Identity “MyAnotherNonPDC” –OperationMasterRole PDCEmulator,RIDMaster,InfrastructureMaster,SchemaMaster,DomainNamingMaste
Seize FSMO roles和Transfer FSMO roles的区别
==================================
比方说DC 2 在Seize 了FSMO role, 那么就相当于DC2 偷偷的把DC1的PDC的role的title给拿过来了, 说它是PDC. 但是DC1并不知道它的title被别人拿走了. 那么在DC1重启之后, 就会重新宣布它还是PDC, 于是5个roles就会自动的换回DC1之上.
所以, 一劳永逸的方法有两个:
- A. 在DC2 Seize了FSMO roles之后, 把DC1 立即shut down. 永不再启用.
- B. 不要用Seize, 而是使用Transfer. 这样DC1和DC2就会在谁拿这个title上有个沟通. 永久的完成角色的转换.
在这里感谢宝妮屋同学的精彩解释.
当新PDC中的Sysvol文件夹中为空时, 可以执行下面的步骤, 来完成Sysvol的rebuild
=================================
SYSVOL Replicated Through DFS-R – Authoritative Restore – Steps To Take
To perform an authoritative restore of the SYSVOL when using DFS-R, use the following steps:
- Start the Registry Editor
- Navigate to "HKLM\SYSTEM\CurrentControlSet\Services\DFSR"
- Create a key called "Restore" (only time only)
- Create a string value called "SYSVOL" (only time only)
- For the string value called "SYSVOL" assign the value of authoritative
- Navigate to "HKLM\SYSTEM\CurrentControlSet\Control\BackupRestore"
- Create a key called "SystemStateRestore" (only time only)
- Create a string value called "LastRestoreId" (only time only)
- For the string value called "LastRestoreId" [1] assign the value of 10000000-0000-0000-0000-000000000000
- Stop the DFSR Service
- Start the DFSR Service
From the command-line the same can be achieved through:
- REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\DFSR\Restore" /v SYSVOL /t REG_SZ /d "authoritative" /f
- [1] REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\BackupRestore\SystemStateRestore" /v LastRestoreId /t REG_SZ /d "10000000-0000-0000-0000-000000000000" /f
- NET STOP DFSR
- NET START DFSR
其他
=================================
一些其他的相关命令:
net stop dns
net stop netlogon
ipconfig /flushdns
net start dns
net start netlogon
ipconfig /registerdns
可以使用下面的命令来对DC进行检测并输出日志, 供troubleshoot.
dcdiag /v >c:\temp\dcdiag.log
或
dcdiag /v | out-file c:\temp\dcdiag.log
使用下面的命令来检查FSMO是否迁移成功
netdom query fsmo
注意
=================================
1. 新promo的DC一定不要跟老的DC用一样的机器名和IP地址, 否则会出错. 感谢Kun总的分享.
2. Windows Server 2008, 2008 R2, 2012, 2012 R2后, Sysvol的replication都是通过DFS service来做的, 2003和2003 R2都是通过FRS service 来做的.
笔者的环境有一台DC, 由于Windows 2012的测试版过期之后, 会一个小时重启一次, 即使有key也无法把DC convert过来. 所以就有了迁移DC的需求. 迁移了FSMO之后, 发现新DC还是无法独立承担DC的角色. 运行DCDiag, 发现如下的错误信息.
Fatal Error:DsGetDcName (servername) call failed, error 1355
网上看了不少帖子, 最后也没找到合适的解决方法. 后来经过同事的帮助, 发现新DC的c:\windows\sysvol文件夹为空, 而且查看该DC的共享也是空的, 所以无法接受DC信息的replication.
后来rebuild了sysvol之后, 问题解决了.