(2016-07-31) Configuring ADFS To Use A Custom SQL Port
Posted by Jorge on 2016-07-31
If for whatever reason you need to change the default SQL port and you need to tell ADFS to use it, or if you need to move the DBs to another SQL server, you can use the following procedure:
–
Retrieving the current connection string for the configuration DB:
Execute the following commands on any ADFS Server:
$fedSvcSTS = Get-WmiObject -namespace root/ADFS -class SecurityTokenService
$fedSvcSTSConfigDBConnectionString = $fedSvcSTS.ConfigurationdatabaseConnectionstring
$fedSvcSTSConfigDBConnectionString
–
Setting a new connection string for the configuration DB:
Execute the following commands ON EVERY ADFS SERVER!:
$fedSvcSTSConfigDBNewConnectionString = "Data Source=SQL1.DOMAIN.COM\SQLINSTANCE,10001;Failover Partner=SQL2.DOMAIN.COM\SQLINSTANCE,10001;Initial Catalog=ADFSConfiguration;Integrated Security=True" <—example values!!!
$fedSvcSTS = Get-WmiObject -namespace root/ADFS -class SecurityTokenService
$fedSvcSTS.ConfigurationdatabaseConnectionstring = $fedSvcSTSConfigDBNewConnectionString
$fedSvcSTS.put()
Restart-Service ADFSSRV
–
Retrieving the current connection string for the artifact DB:
Execute the following commands on any SQL Based ADFS Server, or the primary WID based ADFS Server:
$fedSvcSTSArtifactDBConnectionString = (Get-ADFSProperties).ArtifactDbConnection
–
Setting a new connection string for the artifact DB:
Execute the following commands on any SQL Based ADFS Server, or the primary WID based ADFS Server:
$fedSvcSTSArtifactDBNewConnectionString = "Data Source=SQL1.DOMAIN.COM\SQLINSTANCE,10001;Failover Partner=SQL2.DOMAIN.COM\SQLINSTANCE,10001;Initial Catalog=ADFSArtifactStore;Integrated Security=True" <—example values!!!
Set-ADFSProperties -ArtifactDbConnection $fedSvcSTSArtifactDBNewConnectionString
Restart-Service ADFSSRV
–
Cheers,
Jorge
———————————————————————————————
* This posting is provided "AS IS" with no warranties and confers no rights!
* Always evaluate/test yourself before using/implementing this!
* DISCLAIMER: https://jorgequestforknowledge.wordpress.com/disclaimer/
———————————————————————————————
############### Jorge’s Quest For Knowledge #############
######### http://JorgeQuestForKnowledge.wordpress.com/ ########
———————————————————————————————
Leave a Reply