Active Directory密码移植/迁移到数据库

时间:2012-03-29 14:51:23

标签: encryption active-directory passwords

我们正在扩展现有的软件产品,该产品使用Active Directory将用户凭据存储到云解决方案以存储用户凭据

我想知道如何将这些AD密码迁移/移植到新数据库,而不是要求用户重置密码。我知道我们无法检索普通密码,而是希望了解我们如何移植这些密码并使用特定的解密库来验证这些密码。

我们可以将此密码移至新的SQL数据库,但我们如何验证密码?我们将使用哪种加密算法和盐?

谢谢,

1 个答案:

答案 0 :(得分:0)

本月大部分时间我都在与一个将各种Active Directory林整合到一个域中的客户合作。我们没有使用任何第三方工具 - 只是标准的Microsoft实用程序,即Active Directory迁移工具(ADMT)v3和Exchange迁移向导(Exchange Server 2003部署工具之一) - 但它们似乎可以完成这项工作。

将数百个用户迁移到新帐户(​​使用新密码)会导致大量支持调用,我想让ADMT密码迁移DLL正常工作。这需要一些时间,但在我的企业支持同事(实际上是PSS电话)的帮助下,我们找到了一条路。这就是所需要的:

(作为参考,源域和目标域都在Windows Server 2003域和林功能模式下,运行带有服务包1和2的Windows Server 2003。)

Make sure that there is a trust in place between the source and target domains.
Install ADMT by running admtsetup.exe and follow the installation wizard on the computer that will be used for the migration (I used a domain controller in the source domain but ideally you would have dedicated computers for migration activities and it seems logical that this should be in the target domain).
If not already created by ADMT, create a new domain local group called domainname$$$. This group must be empty, and is required in order to migrate the sIDHistory information between source and target accounts.
On the domain controller that will be used to export the account information (usually the DC holding the PDC Emulator operations master role for the source domain), create/set a value of 1 for a DWORD registry key called TcpipClientSupport in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\LSA\.
In both the source and target domains, ensure that success and failure auditing is enabled for account management.
On a computer with ADMT installed, create a password encryption key for each source domain, by shelling out to a command prompt and entering the following commands:
cd %systemroot%\ADMT
admt key /option:create /sourcedomain:<em>domainname</em> /keyfile:<em>filename</em>.pes
(the domainname can be specified in NetBIOS or DNS format.)
On the domain controller in the source domain that holds the PDC Emulator operations master role, connect to the computer with ADMT installed (e.g. via the c$ administration share) and access the %systemroot%\ADMT\PES folder.
Run pwdmig.exe to install the ADMT Password Migration DLL and follow the installation wizard. During the installation, supply the password encryption (.PES) file that was created earlier.
This is the step that’s not in the instructions – even though the password encyption file was supplied during the installation of the ADMT Password Migration DLL, it still needs to be imported manually on the PDC Emulator, by shelling out to a command prompt and entering the following commands:
cd %systemroot%\ADMT
admt key /option:import /sourcedomain:<em>domainname</em> /keyfile:<em>filename</em>.pes
On the domain controller that will be used to export the account information, create/set a value of 1 for a DWORD registry key called AllowPasswordExport in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\LSA\. Note that this key constitutes a security risk and should only be enabled during the period of migration.
Restart the computer with the ADMT Password Migrator DLL installed.
Start the Password Export Server service.

大部分内容与文档完全相同 - 主要区别在于需要手动导入密码加密文件。没有这个,我收到以下消息:

错误 无法与密码导出服务器建立会话。源密码导出服务器和目标服务器没有相同的源域加密密钥。

最后,需要什么权限?我使用Local System作为密码导出服务器服务。对于其他所有内容,我使用了一个帐户,该帐户在两个具有相同密码的林中创建,并且是Domain Admins组的成员。这有点过分,最佳做法是使用具有最低要求权限的帐户。基本上,需要一个帐户:

Domain administrator in the source domain.
Local administrator on the computer on which ADMT is installed.
Delegated permissions on OUs that are targets for resource migration in the target domain, including the extended right to Migrate SID History (visible in the Security for an object using the Advanced Features view in Active Directory Users and Computers).

可以在ADMT v3迁移指南中找到进一步的建议。