由于不同域名之间的信任问题,当尝试从不同域名中恢复SharePoint列表时,将会出现“访问被拒绝”的错误。要解决这个问题,需要进行以下步骤:
在目标域中创建与源域相同的用户和组,并分配相应的权限,以便在恢复列表时可以访问该列表。
运行以下PowerShell命令以授予目标域的用户访问源域的权限:
New-SPTrustedIdentityTokenIssuer -Name "SourceDomainName" -IsTrustBroker:$true -PrivateKeyFilePath "C:\PrivateKeyFile.pfx" -RegisteredIssuerName "SourceDomainName" -SignInUrl "https://SourceDomainName/adfs/ls/" -IdentifierClaim "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
在目标域的中央管理区域中打开“管理信任”页面,并通过单击“信任”选项卡设置刚刚创建的信任。
设置源域的安全令牌服务以信任目标域。
设置完毕后,我们就可以通过目标域名来访问源域中的SharePoint列表了。
示例代码:
New-SPTrustedIdentityTokenIssuer -Name "SourceDomainName" -IsTrustBroker:$true -PrivateKeyFilePath "C:\PrivateKeyFile.pfx" -RegisteredIssuerName "SourceDomainName" -SignInUrl "https://SourceDomainName/adfs/ls/" -IdentifierClaim "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
Set-SPAuthenticationRealm -Realm "SourceDomainName" Set-SPAuthenticationProvider -Identity "SourceDomainName" -IsTrusted $True -PassiveSignInUrl "https://TargetDomainName/_trust/" $wa = Get-SPWebApplication https://Servername:PortNumber $ap = New-SPAuthenticationProvider -