PowerShell to add ADFS relay trust

 Can write a for loop if have many

$tmp= (Get-AdfsRelyingPartyTrust -name "XXXX")
$a = $tmp.Identifier
$a = $a + "https://hkadfsfwp01.test.local/SAML20/SP"


$EP =New-AdfsSamlEndpoint -Binding "POST" -Protocol "SAMLAssertionConsumer" -Uri "https://pa.test.local/SAML/SP/ACS"
$EndpointArray() = $tmp.SAMLEndpoint +$EP
Get-AdfsRelyingPartyTrust -name "XXXX" | Set-AdfsRelyingPartyTrust -Identifier $a -SAMLEndpoint $EndpointArray


 

 

https://docs.microsoft.com/en-us/powershell/module/adfs/new-adfssamlendpoint?view=windowsserver2022-ps

留言