New-SPAuthenticationProvider

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

Syntax

New-SPAuthenticationProvider
   -ASPNETMembershipProvider <String>
   -ASPNETRoleProviderName <String>
   [-AssignmentCollection <SPAssignmentCollection>]
   [<CommonParameters>]
New-SPAuthenticationProvider
   -TrustedIdentityTokenIssuer <SPTrustedIdentityTokenIssuerPipeBind>
   [-AssignmentCollection <SPAssignmentCollection>]
   [<CommonParameters>]
New-SPAuthenticationProvider
   [-AllowAnonymous]
   [-AssignmentCollection <SPAssignmentCollection>]
   [-DisableKerberos]
   [-UseBasicAuthentication]
   [-UseWindowsIntegratedAuthentication]
   [<CommonParameters>]

Description

此 Cmdlet 包含一個以上的參數集。 您可能只使用一個參數集中的參數,但不可以結合不同參數集的參數。 如需如何使用參數集的詳細資訊,請參閱 Cmdlet 參數集

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

--NTLM、傳統 NTLM、交涉和傳統交涉只能在 Web 應用程式中設定。 --對於 ASP.NET 成員資格提供者或角色提供者,不會保存任何物件。 物件會建立並用於在 Web 應用程式中設定這種類型的驗證提供者。 --針對 STS 驗證提供者,會在 SPFarm 物件中建立並保存物件。

您無法使用傳統 NTLM 搭配任何宣告型驗證類型。

如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet

範例

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

$ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication
Set-SPWebApplication -Name "Claims Windows Web App" -ApplicationPool "Claims App Pool" -ApplicationPoolAccount "redmond\appool" -Url http://<servername> -Port 80 -AuthenticationProvider $ap

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

---------------------------EXAMPLE2------------------

$ap = New-SPAuthenticationProvider -ASPNETMembershipProvider "membership" -ASPNETRoleProviderName "rolemanager"
Set-SPWebApplication -Name "Claims Windows Web App" -ApplicationPool "Claims App Pool" -ApplicationPoolAccount "redmond\appool" -Url http://<servername> -Port 80 -AuthenticationProvider $ap

此範例會建立以 ASP.NET 成員資格角色提供者為基礎的驗證提供者。

---------------------------EXAMPLE3------------------

$ap = New-SPAuthenticationProvider -TrustedIdentityTokenIssuer | Get-SPTrustedIdentityTokenIssuer "LiveIDSTS"
Set-SPWebApplication -Name "Claims Windows Web App" -ApplicationPool "Claims App Pool" -ApplicationPoolAccount "redmond\appool" -Url http://<servername> -Port 80 -AuthenticationProvider $ap

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

參數

-AllowAnonymous

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-ASPNETMembershipProvider

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

此值必須是有效的 ASP.NET 成員資格提供者名稱,例如 myMembershipProvider。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-ASPNETRoleProviderName

指定角色提供者的名稱。

此值必須是有效的 ASP.NET 角色提供者名稱,例如 myRoleProvider。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-AssignmentCollection

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

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

Type:SPAssignmentCollection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-DisableKerberos

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-TrustedIdentityTokenIssuer

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

此值必須為下列格式之一:

--有效的 GUID,格式為 12345678-90ab-cdef-1234-567890bcdefgh --TrustedIdentityTokenIssuer 的有效名稱 (例如 myRoleProvider) --有效 SPTrustedIdentityTokenIssuer 物件的實例

Type:SPTrustedIdentityTokenIssuerPipeBind
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-UseBasicAuthentication

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-UseWindowsIntegratedAuthentication

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019