配置联合服务器

在计算机上安装 Active Directory 联合身份验证服务(AD FS)角色服务后,即可将此计算机配置为成为联合服务器。 可以执行以下操作之一:

在新联合服务器场中配置第一个联合服务器

使用 Active Directory 联合身份验证服务配置向导在新的联合服务器场中配置第一个联合服务器

Note

在执行此过程之前,请确保你具有域管理员权限或具有可用的域管理员凭据。

  1. On the Server Manager Dashboard page, click the Notifications flag, and then click Configure the federation service on the server.

    此时会打开 Active Directory 联合身份验证服务配置向导

  2. On the Welcome page, select Create the first federation server in a federation server farm, and then click Next.

  3. “连接到 AD DS ”页上,使用加入此计算机的 Active Directory(AD)域的域管理员权限指定帐户,然后单击“ 下一步”。

  4. “指定服务属性 ”页上执行以下作,然后单击“ 下一步” :

    • 导入包含之前获取的安全套接字层(SSL)证书和密钥的 .pfx 文件。 在 步骤 2:注册 AD FS 的 SSL 证书后,你已获取此证书,并将其复制到要配置为联合服务器的计算机上。 To import the .pfx file via the wizard, click Import, and then browse to the file's location. 出现提示时输入 .pfx 文件的密码。

    • 为您的联合服务提供名称。 For example, fs.contoso.com. 此名称必须与证书中的使用者或使用者可选名称之一相匹配。

    • 提供联合身份验证服务的显示名称。 For example, Contoso Corporation. 用户在 Active Directory 联合身份验证服务(AD FS)登录页上看到此名称。

  5. 在“ 指定服务帐户 ”页上,指定服务帐户。 可以创建或使用现有的组托管服务帐户(gMSA),也可以使用现有的域用户帐户。 如果选择创建新 gMSA 帐户的选项,请为新帐户指定名称。 If you select the option to use an existing gMSA or domain account, click Select to select an account.

    Note

    使用 gMSA 帐户的好处是其自动协商的密码更新功能。

    Warning

    如果要使用 gMSA 帐户,则必须在运行 Windows Server 2012作系统的环境中至少有一个域控制器。

    如果 gMSA 选项已禁用,并且你看到错误消息(如 组托管服务帐户)不可用,因为 KDS 根密钥尚未设置,则可以通过在域控制器上运行 Windows Server 2012 或更高版本的域控制器上运行以下 Windows PowerShell 命令,在 Active Directory 域中启用 gMSA: Add-KdsRootKey –EffectiveTime (Get-Date).AddHours(-10)。 Then return to the wizard, click Previous, and then click Next to re-enter the Specify Service Account page. 现在应启用 gMSA 选项。 可以选择它并输入要使用的 gMSA 帐户名称。

  6. 在“ 指定配置数据库 ”页上,指定 AD FS 配置数据库,然后单击“ 下一步”。 可以使用 Windows 内部数据库(WID)在此计算机上创建数据库,也可以指定Microsoft SQL Server 的位置和实例名称。

    有关详细信息,请参阅 AD FS 配置数据库的角色

    Important

    如果要创建 AD FS 场并使用 SQL Server 存储配置数据,可以使用 SQL Server 2008 和更新版本,包括 SQL Server 2012 和 SQL Server 2014。

  7. On the Review Options page, verify your configuration selections, and then click Next.

  8. On the Pre-requisite Checks page, verify that all prerequisite checks are successfully completed, and then click Configure.

  9. On the Results page, review the results and check whether the configuration is completed successfully, and then click Next steps required for completing your federation service deployment. 有关详细信息,请参阅 完成 AD FS 安装的后续步骤。 Click Close to exit the wizard.

通过 Windows PowerShell 在新的联合服务器场中配置第一个联合服务器

可以使用新的或现有的 gMSA 帐户或现有域用户帐户创建新的联合服务器场。

  • 如果要使用新的 gMSA 帐户创建新的联合服务器,请执行以下作:

    Important

    必须具有域管理员权限才能在新联合服务器场中创建第一个联合服务器。

    1. 在要配置为联合服务器的计算机上,确保所需的 SSL 证书已导入 本地计算机\My Store 目录。 可以通过在 Windows PowerShell 命令窗口中运行以下命令来验证 SSL 证书是否已导入: dir Cert:\LocalMachine\My 证书按其指纹列在本地 计算机\My Store 目录中。

    2. 在域控制器上,打开 Windows PowerShell 命令窗口并运行以下命令,验证是否已在域中创建 KDS 根密钥: Get-KdsRootKey –EffectiveTime (Get-Date).AddHours(-10) 如果尚未创建,以便输出不显示任何信息,请运行以下命令以创建密钥: Add-KdsRootKey –EffectiveTime (Get-Date).AddHours(-10)

    3. 在要配置为联合服务器的计算机上,打开 Windows PowerShell 命令窗口,然后运行以下命令:

      Install-AdfsFarm -CertificateThumbprint <certificate_thumbprint> -FederationServiceName <federation_service_name> -GroupServiceAccountIdentifier <domain>\<GMSA_Name>$
      

      Warning

      上一个命令末尾需要$符号。

      若要获取其值 <certificate_thumbprint>,请运行 dir Cert:\LocalMachine\My,然后选择 SSL 证书的指纹。 The value of <federation_service_name> is the name of your federation service, for example, fs.contoso.com.

      Note

      如果这不是首次运行此命令,请添加 OverwriteConfiguration 参数。

      Note

      上一个命令创建了一个 WID 服务器场。 如果要创建 SQL Server 服务器场,则必须安装并运行 SQL Server 的实例。

      可以使用以下命令在使用 SQL Server 实例的新场中创建第一个联合服务器: Install-AdfsFarm -CertificateThumbprint <certificate_thumbprint> -FederationServiceName <federation_service_name> -GroupServiceAccountIdentifier <domain>\<GMSA_name>$ -SQLConnectionString "Data Source=<SQL_Host_Name?\<SQL_instance_ name>;Integrated Security=True" 其中 <SQL_Host_Name> 是运行 SQL Server 的服务器的名称, <SQL_instance_name> 是 SQL Server 实例的名称。 If you use the default instance of SQL Server, use a SQLConnectionString value of "Data Source=<SQL_Host_Name>;Integrated Security=True".

      Important

      如果要创建 AD FS 场并使用 SQL Server 存储配置数据,可以使用 SQL Server 2008 和更新版本(包括 SQL Server 2012)。

  • 如果要使用现有域用户帐户创建新的联合服务器,请执行以下作:

    1. 在要配置为联合服务器的计算机上,确保所需的 SSL 证书已导入 本地计算机\My Store 目录。 可以通过在 Windows PowerShell 命令窗口中运行以下命令来验证 SSL 证书是否已导入: dir Cert:\LocalMachine\My 证书按其指纹列在本地 计算机\My Store 目录中。

    2. 在要配置为联合服务器的计算机上,打开 Windows PowerShell 命令窗口,然后运行以下命令: $fscred = Get-Credential 以“域\用户名”格式输入要用于联合身份验证服务帐户的域用户帐户凭据。

    3. 在同一 Windows PowerShell 命令窗口中,运行以下命令:

      Install-AdfsFarm -CertificateThumbprint <certificate_thumbprint> -FederationServiceName <federation_service_name> -ServiceAccountCredential $fscred
      

      若要获取certificate_thumbprint<的值>,请运行dir Cert:\LocalMachine\My,然后选择 SSL 证书的指纹。 <federation_service_name>的值是您的联合服务的名称,例如 fs.contoso.com。

      Note

      如果这不是首次运行此命令,请添加 OverwriteConfiguration 参数。

      Note

      上一个命令创建了一个 WID 服务器场。 如果要创建 SQL Server 场,则必须安装并运行 SQL Server 的实例。

      You can use the following command to create the first federation server in a new farm that uses an instance of SQL Server: Install-AdfsFarm -CertificateThumbprint <certificate_thumbprint> -FederationServiceName <federation_service_name> -ServiceAccountCredential $fscredential -SQLConnectionString "Data Source=<SQL_Host_Name>\<SQL_instance_ name>;Integrated Security=True" where SQL_Host_Name is the name of the server on which SQL Server is running, and SQL_instance_name is the name of the instance of SQL Server. If you use the default instance of SQL Server, use a SQLConnectionString value of "Data Source=<SQL_Host_Name>;Integrated Security=True".

      Important

      如果要创建 AD FS 场并使用 SQL Server 存储配置数据,可以使用 SQL Server 2008 和更新版本,包括 SQL Server 2012 和 SQL Server 2014。

将联合服务器添加到现有的联合服务器场

Important

在开始本部分中的任何过程之前,请确保已完成 步骤 3:安装 AD FS 角色服务

Important

在完成此过程之前,请确保已获取有效的 SSL 服务器身份验证证书。

通过 Active Directory 联合身份验证服务配置向导将联合服务器添加到现有联合服务器场

  1. On the Server Manager Dashboard page, click the Notifications flag, and then click Configure the federation service on the server.

    此时会打开 Active Directory 联合身份验证服务配置向导

  2. On the Welcome page, select Add a federation server to a federation server farm, and then click Next.

  3. “连接到 AD DS ”页上,使用加入此计算机的 AD 域的域管理员权限指定帐户,然后单击“ 下一步”。

  4. On the Specify Farm page, provide the name of the primary federation server in a farm that uses WID or specify the database host name and the database instance name of an existing federation server farm that uses SQL Server.

    Warning

    在 Windows Server® 2012 R2 中,有一种解决方法可以指定 SQL Server 的默认实例。 解决方法是不使用用户界面。 改为使用通过 Windows PowerShell 配置新联合服务器场中的第一台联合服务器中的步骤。

    Important

    如果要创建 AD FS 场并使用 SQL Server 存储配置数据,可以使用 SQL Server 2008 和更新版本(包括 SQL Server 2012)。

  5. “指定 SSL 证书 ”页上,导入包含以前获取的 SSL 证书和密钥的 .pfx 文件。 此证书是所需的服务身份验证证书。 在 步骤 2:注册 AD FS 的 SSL 证书后,你已获取此证书,并将其复制到要配置为联合服务器的计算机。 To import the .pfx file via the wizard, click Import and browse to the file's location. 出现提示时输入 .pfx 文件的密码。

  6. 在“ 指定服务帐户 ”页上,指定在场中创建第一个联合服务器时配置的相同服务帐户。 可以使用现有的组托管服务帐户或现有的域用户帐户。

    Important

    指定的帐户必须与此场中主联合服务器上使用的帐户相同。

  7. On the Review Options page, verify your configuration selections, and then click Next.

  8. On the Pre-requisite Checks page, verify that all prerequisite checks are successfully completed, and then click Configure.

  9. On the Results page, review the results and check whether the configuration is completed successfully, and then click Next steps required for completing your federation service deployment. 有关详细信息,请参阅 完成 AD FS 安装的后续步骤。 Click Close to exit the wizard.

通过 Windows PowerShell 将联合服务器添加到现有联合服务器场

可以使用现有 gMSA 帐户或现有域用户帐户将联盟服务器添加到现有服务器场。

  • 如果要使用现有的 gMSA 帐户将联合服务器加入到场中,请执行以下操作:

    1. 在要配置为联合服务器的计算机上,确保所需的 SSL 证书已导入 本地计算机\My Store 目录。 可以通过在 Windows PowerShell 命令窗口中运行以下命令来验证 SSL 证书是否已导入: dir Cert:\LocalMachine\My 证书按其指纹列在本地 计算机\My Store 目录中。

    2. 在要配置为联合服务器的计算机上,打开 Windows PowerShell 命令窗口,然后运行以下命令。

      Add-AdfsFarmNode -GroupServiceAccountIdentifier <domain>\<GMSA_name>$ -PrimaryComputerName <first_federation_server_hostname> -CertificateThumbprint <certificate_thumbprint>
      

      <domain>\<GMSA_name> 是 AD 域,也是该域中 gMSA 帐户的名称。 <first_federation_server_hostname> 是此现有场中主联合服务器的主机名。

      可以通过在上一步中运行<certificate_thumbprint>来获取dir Cert:\LocalMachine\My该值。

      Note

      如果这不是首次运行此命令,请添加 OverwriteConfiguration 参数。

      Note

      上一个命令创建 WID 场节点。 如果要创建运行 SQL Server 的计算机的服务器场节点,则必须已安装并运行 SQL Server 的实例。

      You can use the following command to add a federation server to an existing farm that is using an instance of SQL Server: Add-AdfsFarmNode -GroupServiceAccountIdentifier <domain>\<GMSA_name>$ -SQLConnectionString "Data Source=<SQL_Host_Name>\<SQL_instance_ name>;Integrated Security=True" where SQL_Host_Name is the name of the server on which SQL Server is running, and SQL_instance_name is the name of the instance of SQL Server. If you use the default instance of SQL Server, use a SQLConnectionString value of "Data Source=<SQL_Host_Name>;Integrated Security=True".

      Important

      如果要创建 AD FS 场并使用 SQL Server 存储配置数据,可以使用 SQL Server 2008 和更新版本,包括 SQL Server 2012 和 SQL Server 2014。

  • 如果要使用现有的域用户帐户将联合服务器加入到场中,请执行以下操作:

    1. 在要配置为联合服务器的计算机上,打开 Windows PowerShell 命令窗口,然后运行以下命令: $fscred = get-credential 以“域\用户名”格式输入要用于联合身份验证服务帐户的域用户帐户凭据。

    2. 在要配置为联合服务器的计算机上,确保所需的 SSL 证书已导入 本地计算机\My Store 目录。 可以通过在 Windows PowerShell 命令窗口中运行以下命令来验证 SSL 证书是否已导入: dir Cert:\LocalMachine\My 证书按其指纹列在本地 计算机\My Store 目录中。

    3. 在同一 Windows PowerShell 命令窗口中,运行以下命令。

      Add-AdfsFarmNode -ServiceAccountCredential $fscred -PrimaryComputerName <first_federation_server_hostname> -CertificateThumbprint <certificate_thumbprint>
      

      Note

      如果这不是首次运行此命令,请添加 OverwriteConfiguration 参数。

      Note

      上一个命令创建 WID 场节点。 如果要创建运行 SQL Server 的计算机的服务器场节点,则必须已安装并运行 SQL Server 的实例。 You can use the following command to add a federation server to an existing farm by using an instance of SQL Server: Add-AdfsFarmNode -ServiceAccountCredential $fscred -SQLConnectionString "Data Source=<SQL_Host_Name>\<SQL_instance_ name>;Integrated Security=True" where SQL_Host_Name is the name of the server on which the instance of SQL Server is running, and SQL_instance_name is the name of the instance of SQL Server. If you use the default instance of SQL Server, use a SQLConnectionString value of "Data Source=<SQL_Host_Name>;Integrated Security=True".

      Important

      如果要创建 AD FS 场并使用 SQL Server 存储配置数据,可以使用 SQL Server 2008 和更新版本,包括 SQL Server 2012 和 SQL Server 2014。

See Also

AD FS 部署

Windows Server 2012 R2 AD FS 部署指南

部署联合服务器场