我正在使用Windows 2008 R2 Enterprise服务器。我正在尝试编写用于生产服务器的依赖方信任的脚本。我写了一个powershell脚本。当我手动创建依赖方信任时,我会选择SAML 1.1配置文件,并且一切正常。当我创建脚本并使用powershell命令Add-ADFSRelyingPartyTrust时,它无法正常工作,并且出现以下错误:



当我搜索该错误时,对我来说(尽管可能是错误的)似乎是SAML 2.0配置文件问题。但是我需要SAML 1.1。

这是我创建依赖方信任的代码:

Write-Host "Configuring relying party trust."
Add-ADFSRelyingPartyTrust -Identifier "$endpoint" -Name "$name" -WSFedEndpoint "$endpoint/" -SignatureAlgorithm "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
Write-Host "Configuring rules."
$ruleSet = New-ADFSClaimRuleSet -ClaimRule 'c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] => issue(store = "Active Directory", types = ("http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname"), query = ";userPrincipalName,mail,givenName,sn;{0}", param = c.Value);'
Set-ADFSRelyingPartyTrust -TargetIdentifier "$endpoint" -IssuanceTransformRules $ruleSet.ClaimRulesString
Write-Host "Done."

当我对有效的依赖信任进行GetADFSRelyingPartyTrust并将其与不起作用的信任进行比较时,请参见规则模板中的区别:

作品:



不起作用:



关于如何摆脱上述错误消息的任何想法?

最佳答案

通过提问并提供上述信息,我找到了自己的答案:

我需要将-IssuanceAuthorizationRules参数传递给命令。

关于powershell - 如何使用Powershell使用SAML 1.1配置文件设置AD FS 2.0?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18967098/

10-11 22:26
查看更多