New-SPAuthenticationProvider

 

適用版本: SharePoint Foundation 2010, SharePoint Server 2010

上次修改主題的時間: 2015-03-09

在伺服器陣列中建立新的驗證提供者。

Syntax

New-SPAuthenticationProvider [-AllowAnonymous <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>] [-DisableKerberos <SwitchParameter>] [-UseBasicAuthentication <SwitchParameter>] [-UseWindowsIntegratedAuthentication <SwitchParameter>]

New-SPAuthenticationProvider -ASPNETMembershipProvider <String> -ASPNETRoleProviderName <String> [-AssignmentCollection <SPAssignmentCollection>]

New-SPAuthenticationProvider -TrustedIdentityTokenIssuer <SPTrustedIdentityTokenIssuerPipeBind> [-AssignmentCollection <SPAssignmentCollection>]

詳細描述

New-SPAuthenticationProvider Cmdlet 會在伺服器陣列中建立新的驗證提供者。

「NTLM」、「傳統 NTLM」、「交涉」和「傳統交涉」只能在 Web 應用程式中設定。

對於 ASP.NET 成員資格提供者或角色提供者,並不會保存物件。物件的建立與使用都是為了在 Web 應用程式中設定這種類型的驗證提供者。

對於 STS 驗證提供者,會建立物件並保存在 SPFarm 物件中。

不允許搭配宣告式驗證類型使用「傳統 NTLM」。

Parameters

參數 必要 類型 描述

ASPNETMembershipProvider

必要

System.String

指定成員資格提供者的名稱。

此類型必須是有效的 ASPNet 成員資格提供者名稱,例如 myMembershipProvider。

ASPNETRoleProviderName

必要

System.String

指定角色提供者的名稱。

此類型必須是有效的 ASPNet 角色提供者名稱,例如 myRoleProvider。

TrustedIdentityTokenIssuer

必要

Microsoft.SharePoint.PowerShell.SPTrustedIdentityTokenIssuerPipeBind

指定驗證提供者的身分識別。

此類型必須是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID、TrustedIdentityTokenIssuer 的有效名稱 (例如 myRoleProvider),或有效之 SPTrustedIdentityTokenIssuer 物件的執行個體。

AllowAnonymous

選用

System.Management.Automation.SwitchParameter

指定 Web 應用程式是否允許匿名存取。

AssignmentCollection

選用

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

為能適當處置物件而管理物件。使用 SPWebSPSite 等物件可能會耗用大量的記憶體,因此在 Windows PowerShell 指令碼中使用這些物件時,必須適當地管理記憶體。您可以使用 SPAssignment 物件將物件指派給變數,並在不需要時處置這些物件,以釋放記憶體。使用 SPWebSPSiteSPSiteAdministration 物件時,若未使用指派集合或 Global 參數,將會自動處置這些物件。

注意

使用 Global 參數時,所有物件會包含在全域儲存區內。若未立即使用物件,或未使用 Stop-SPAssignment 命令處置物件,將會發生記憶體不足的狀況。

DisableKerberos

選用

System.Management.Automation.SwitchParameter

指定 Web 應用程式是否要停用 Kerberos 驗證。

UseBasicAuthentication

選用

System.Management.Automation.SwitchParameter

指定 Web 應用程式是否要使用基本驗證。

UseWindowsIntegratedAuthentication

選用

System.Management.Automation.SwitchParameter

指定 Web 應用程式是否要使用 Windows 整合式驗證。

輸入類型

傳回類型

Example

---------------------------範例1------------------

$ap = New - SPAuthenticationProvider -UseWindowsIntegratedAuthentication

Set-SPWebApplication -Name "Claims Windows Web App" -ApplicationPool "Claims App Pool" -ApplicationPoolAccount "redmond\appool" -Url https://servername -Port 80 -AuthenticationProvider $ap

此範例會建立 Windows 宣告驗證提供者

---------------------------範例2------------------

$ap = New-SPAuthenticationProvider -ASPNETMembershipProvider "membership" -ASPNETRoleProviderName "rolemanager"

Set-SPWebApplication -Name "Claims Windows Web App" -ApplicationPool "Claims App Pool" -ApplicationPoolAccount "redmond\appool" -Url https://servername -Port 80 -AuthenticationProvider $ap

此範例會建立 ASP.net 成員資格角色提供者驗證提供者。

---------------------------範例 3------------------

$ap = New - SPAuthenticationProvider -TrustedIdentityTokenIssuer | Get-SPTrustedIdentityTokenIssuer "LiveIDSTS"

Set-SPWebApplication -Name "Claims Windows Web App" -ApplicationPool "Claims App Pool" -ApplicationPoolAccount "redmond\appool" -Url https://servername -Port 80 -AuthenticationProvider $ap

此範例是建立受信任 Token 簽署者驗證提供者。

See Also

Reference

New-SPAuthenticationProvider