This is for editing the Windows Azure Pack URL’s and Ports. Works as of WAP for Server 2012 R2 UR5.

Modify your variables accordingly. I have each WAP site on an individual server for a scaled deployment so this sets all the sites to use the 443.

#Set Variables
$WAPDB = "WAPDB" 
$AdminSite = "wapadmin.domain.com" 
$AdminAuth = "wapauth.domain.com" 
$Tenant = "wap.domain.com" 
$TenantAuth = "waplogon.domain.com"

#Run on Tenant Site 
Import-Module -Name MgmtSvcConfig 
Set-MgmtSvcFqdn -Namespace "TenantSite" -FullyQualifiedDomainName $Tenant -Port 443 -Server $WAPDB

#Run on Tenant Auth Site 
Set-MgmtSvcFqdn -Namespace "AuthSite" FullyQualifiedDomainName $TenantAuth -Port 443 -Server $WAPDB 
$ConnectionString = "Data Source=$WAPDB;Initial Catalog=Microsoft.MgmtSvc.Config;User ID=sa;Password=P@ssw0rd" 
Set-MgmtSvcRelyingPartySettings -Target Tenant MetadataEndpoint https://$TenantAuth/FederationMetadata/2007-06/FederationMetadata.xml -ConnectionString $ConnectionString DisableCertificateValidation 
Set-MgmtSvcIdentityProviderSettings -Target Membership MetadataEndpoint https://$Tenant/FederationMetadata/2007-06/FederationMetadata.xml -ConnectionString $ConnectionString DisableCertificateValidation

#Run on Admin Site 
Import-Module -Name MgmtSvcConfig 
Set-MgmtSvcFqdn -Namespace "AdminSite" -FullyQualifiedDomainName $AdminSite -Port 443 -Server $WAPDB

#Run on Admin Auth Site 
Import-Module -Name MgmtSvcConfig 
Set-MgmtSvcFqdn -Namespace "WindowsAuthSite" -FullyQualifiedDomainName "$AdminAuth" -Port 443 -Server $WAPDB 
$ConnectionString = "Data Source=$WAPDB;Initial Catalog=Microsoft.MgmtSvc.Config;User ID=sa;Password=P@ssw0rd" 
Set-MgmtSvcRelyingPartySettings -Target Admin -MetadataEndpoint "https://$AdminAuth/FederationMetadata/2007-06/FederationMetadata.xml" -ConnectionString $ConnectionString -DisableCertificateValidation 
Set-MgmtSvcIdentityProviderSettings -Target Windows -MetadataEndpoint "https://$AdminSite/FederationMetadata/2007-06/FederationMetadata.xml" -ConnectionString $ConnectionString -DisableCertificateValidation

I’d like to make this into a single script that prompts for servers names, urls, ports etc and uses remote powershell to configure the various servers.

Enjoy

Dan

Daniel Apps

Hi, I'm Daniel Apps — AI platform enthusiast, unapologetic infrastructure nerd, and dad to two small humans. I write about infrastructure, AI industry topics, and the real-world chaos of modern IT.

More about me →

s