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

This cmdlet contains more than one parameter set. You may only use parameters from one parameter set, and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet parameter sets.

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
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ASPNETMembershipProvider

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

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

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ASPNETRoleProviderName

指定角色提供者的名稱。

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

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DisableKerberos

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

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-TrustedIdentityTokenIssuer

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

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

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

Type:SPTrustedIdentityTokenIssuerPipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-UseBasicAuthentication

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

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-UseWindowsIntegratedAuthentication

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

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition