0

我需要通过 SSL 配置 AD LDS 我两天以来都在尝试每篇文章,这http://erlend.oftedal.no/blog/?blogid=7似乎是合理的,但我被困在为证书授予 AD LDS 实例的读取权限.

这是官方文章,第一步真的很模糊不知道该怎么办 https://msdn.microsoft.com/en-us/library/cc725767(v=ws.10).aspx#BKMK_1

我正在使用 Windows Server 2012 r2

4

1 回答 1

0

我已经通过先配置 Enterprise CA 然后使用此页面上的指南来完成

http://social.technet.microsoft.com/wiki/contents/articles/2980.ldap-over-ssl-ldaps-certificate.aspx#Reasons

按以下顺序

  1. 发布支持服务器认证的证书

    在此步骤的第 5 点,即

    “5. 在“复制模板”对话框中,保留默认选中的 Windows Server 2003 Enterprise 选中状态,然后单击“确定”。

    仔细选择您的相关操作系统,教程说保持默认,但我使用的是 Windows Server 2012 r2,所以我选择了我正在使用的那个。选择您的相关操作系统。

  2. 导出 LDAPS 证书并导入以用于 AD DS

  3. 验证 LDAPS 连接

为什么我需要通过 SSL 进行 ADLDS 连接?

因为我希望用户更改他/她的 ADLDS 密码,所以使用 PrincipalContext 的非 SSL 连接不允许我这样做。所以现在我正在使用下面的代码,它就像一个魅力。

PrincipalContext pc = new PrincipalContext(
                    ContextType.ApplicationDirectory,
                    "YourServerUrl:YourSSLPort",
                    "CN=YourPartitionName,DC=partition,DC=com",
                    ContextOptions.SimpleBind | ContextOptions.SecureSocketLayer,
                    "FullDistinguisedNameOfUser",
                    "PasswordOfUser");

bool IsUserValidated = pc.ValidateCredentials(
                    "FullDistinguisedNameOfUser",
                    "PasswordOfUser",
                    ContextOptions.SimpleBind | ContextOptions.SecureSocketLayer);


            if (IsUserValidated)
            {
                UserPrincipal up = UserPrincipal.FindByIdentity(
                "FullDistinguisedNameOfUser", 
                "PasswordOfUser");

                up.ChangePassword("UserOldPassword", "UserNewPassword");
            }
于 2016-04-05T14:42:31.887 回答