Skip to content

Ulysses Neves

Microsoft Entra ID, authentication, and hybrid identity troubleshooting.

Menu
  • Início
  • Microsoft Azure
  • Microsoft AD FS
  • Microsoft 365
  • Contact
Menu

AD FS – Deploying AD FS on SQL Server running on a custom port

Posted on 6 de July de 2021

Hi mates. Today, we’re going to explain how to deploy AD FS farm with SQL Server configured with a custom TCP port using Server Manager wizard and PowerShell.

Lab environment:
– AD FS Server version: 2019
– SQL Server version: 2019
– SQL Service version: 2019
– Custom SQL port: 53324

Requirements on:
SQL server:
– SQL service installed
AD FS:
– SSL certificate installed
– Standard domain account or GMSA account to be used by Active Directory Federation Services
Note: In case you need instructions on how to install the SSL certificate on AD FS, please check this article.

I will not explain how to configure the custom port on SQL server because Microsoft has already published an article with steps to configure it.

Install AD FS role using PowerShell

As the first step to install AD FS service, install the role running the command below on PowerShell:

Install-windowsfeature adfs-federation –IncludeManagementTools

In this article, I will cover the configuration steps using both Server Manager and PowerShell.

Install AD FS with SQL on a custom port using the Server manager

Configure the new AD FS farm using the AD FS configuration Wizard on Server Manager.

Open the Server Manager » Click on the orange flag below and select Configure the federation service on this server.

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

By default, the configuration wizard shows the account signed to the server to be used during the setup. This account must have Domain Admin permissions. You can use the change button if the account running the wizard is not part of the domain group Domain Admins.
Click Next.

On Service properties, provide the information below:
1 – Select the SSL certificate with CN matching to the Federation Service Name to be used, installed as mentioned at the beginning of this article.
2 – Provide a Federation Service Name. Ex: fs.contoso.com
3 – Provide a Service Display Name. This name will appear on the AD FS Sign-in page.

Click Next.

In the step below, we can create a GMSA account or choose a standard domain account. In our case, I created a standard domain account to be used by the AD FS service. The requirements for the AD FS service account are mentioned below:

  • Any standard domain account can be used as a service account for AD FS. Group Managed Service accounts are also supported. The permissions required at runtime will be added automatically when you configure AD FS.
  • The User Rights Assignment required for the AD service account is ‘Log on as a Service’
  • The User Rights Assignments required for the ‘NT Service\adfssrv’ and ‘NT Service\drs’ are ‘Generate Security Audits’ and ‘Log on as a Service’.
  • Group Managed service accounts require at least one domain controller running Windows Server 2012 or higher. The GMSA must live under the default ‘CN=Managed Service Accounts’ container.
  • For Kerberos authentication, the service principal name ‘HOST/<adfs\_service\_name>‘ must be registered on the AD FS service account. By default, AD FS will configure this when creating a new AD FS farm. If this fails, such as in the case of a collision or insufficient permissions, you’ll see a warning, and you should add it manually.
    Reference: https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/overview/ad-fs-requirements#BKMK_4

In this deployment, I will use a standard domain account with the steps below:
1 – Select option Use an existing domain user account or group Managed Service Account.
2 – Select the service account.
3 – Provide the service account’s password.

Click Next.

In this window, we have to select which database type AD FS service will use. We can configure it to use WID (Windows Internal Database) or SQL database. We are going to configure the service to use a SQL database using custom port 53324 that has been configured on the SQL server before.

To configure SQL server, let’s select the option Specify the location of a SQL Server database and provide the information below:
Database Host Name on format: SQL Server Name + comma + custom port
Ex: sqlserver,53324
Note: In case your SQL server uses default port 1433, it’s not necessary to mention the port.
Database Instance: This is required only if you don’t use the default SQL instance.

Click Next.

Once the AD FS is able to reach the SQL server on the custom port, you might see the review screen below:

Now with the configuration provided, we can see on the screen below that all prerequisites to have the service configured are completed. Let’s click on Configure.

With the installation finished, we see an alert requesting server reboot and to finish the wizard, select Close.

Install AD FS with SQL on a custom port using PowerShell

Another option to configure the AD FS service is to run the AD FS configuration step using PowerShell command below:

Get the credential used for the federation service account
 $serviceAccountCredential = Get-Credential -Message "Enter the credential for the Federation Service Account."
Install-AdfsFarm -CertificateThumbprint:"SSL-CERT-THUMBPRINT"
 -FederationServiceDisplayName:"AD FS with SQL" -FederationServiceName:"fs.contoso.com"
 -ServiceAccountCredential:$serviceAccountCredential `
 -SQLConnectionString:"Data Source=sqlserver,53324;Initial Catalog=ADFSConfiguration;Integrated Security=True;Min Pool Size=20"

Note: Customize the command above as per your configuration requirements.

Validate AD FS installation on the SQL server

With the service installed, we can see both AD FS configuration databases created on SQL server:

Checking the AD FS service account’s permissions on both databases above, we see db_genevaservice and db_owner roles defined:

Summary

In this article, we covered how to deploy AD FS farm with SQL Server configured with a custom TCP port using Server Manager wizard and PowerShell.

I hope you have enjoyed reading this article and it helps you manage your AD FS environment.

Enjoyed the article? Like and share. 🙂

Note: I do not represent the organization I work for, all the opinions expressed here, are my own. This post is provided AS IS with no warranties or guarantees and confers no rights.

In case you have any suggestion or feedback, please leave a comment.

[ ]’s
Ulysses Neves

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Microsoft Authenticator Will Block Jailbroken Devices in 2026 — What You Need to Know 17 de March de 2026
  • Enhancing Azure role activation security with FIDO2/Passkeys 23 de September de 2024
  • Microsoft Entra ID CAP | Enforcing WHfB using Authentication Strength 21 de April de 2024
  • Troubleshooting Error Code ‘0x000005e’ in WHfB: PIN Authentication Woes 11 de February de 2024
  • WHfB: Fixing Windows Hello for Business error ‘LogoncertTemplateReady: NO (StateNoTemplate)’ 29 de December de 2023

Archives

  • March 2026
  • September 2024
  • April 2024
  • February 2024
  • December 2023
  • September 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019

Tags

#aaddownleveldevice #aadhybridjoin #adfs #adfsonsql #azuread #azureauth #azureCA #azuredevice #azurehybridjoin #azuremfa #azuresecurity #capolicy #cloudkerberostrust #conditionalaccess #conditionalaccesspolicy #deviceregistration #gmsaaccount #gopasswordless #hybridaadjoin #mfaserver #msadfs #msazure #msidentity #namedlocation #sslcertificatevalidation #tshootadfs #tshoothybridjoin #tshootwaptrust #waptrust #WHFBcerttrust #whfbdeployment #WHfBhybridsetup #widdatabase adconnect authenticationcontext authenticationstrength az500 azuread azuremfa azurepim azuresecurity cloudsecurity microsoft365 msazure WHfB
©2026 Ulysses Neves | Design: Newspaperly WordPress Theme
Ulysses Neves
Gerenciar Consentimento de Cookies
Para fornecer as melhores experiências, usamos tecnologias como cookies para armazenar e/ou acessar informações do dispositivo. O consentimento para essas tecnologias nos permitirá processar dados como comportamento de navegação ou IDs exclusivos neste site. Não consentir ou retirar o consentimento pode afetar negativamente certos recursos e funções.
Funcional Always active
O armazenamento ou acesso técnico é estritamente necessário para a finalidade legítima de permitir a utilização de um serviço específico explicitamente solicitado pelo assinante ou utilizador, ou com a finalidade exclusiva de efetuar a transmissão de uma comunicação através de uma rede de comunicações eletrónicas.
Preferências
O armazenamento ou acesso técnico é necessário para o propósito legítimo de armazenar preferências que não são solicitadas pelo assinante ou usuário.
Estatísticas
O armazenamento ou acesso técnico que é usado exclusivamente para fins estatísticos. O armazenamento técnico ou acesso que é usado exclusivamente para fins estatísticos anônimos. Sem uma intimação, conformidade voluntária por parte de seu provedor de serviços de Internet ou registros adicionais de terceiros, as informações armazenadas ou recuperadas apenas para esse fim geralmente não podem ser usadas para identificá-lo.
Marketing
O armazenamento ou acesso técnico é necessário para criar perfis de usuário para enviar publicidade ou para rastrear o usuário em um site ou em vários sites para fins de marketing semelhantes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Ver preferências
  • {title}
  • {title}
  • {title}