Get-SPAuthenticationProvider

适用于: SharePoint Foundation 2010, SharePoint Server 2010

上一次修改主题: 2015-03-09

返回验证提供程序。

Syntax

Get-SPAuthenticationProvider [[-Identity] <SPAuthenticationProviderPipeBind>] [-WebApplication] <SPWebApplicationPipeBind> [-Zone] <Default | Intranet | Internet | Custom | Extranet> [-AssignmentCollection <SPAssignmentCollection>]

详细说明

Get-SPAuthenticationProvider cmdlet 返回指定的 Web 应用程序区域中的验证提供程序。以下是可用于 SharePoint 2010 产品的标准验证提供程序:NTLMClassic NTLMNegotiateClassic Negotiate

有关 Windows PowerShell for SharePoint 产品的权限和最新信息,请参阅联机文档 (https://go.microsoft.com/fwlink/?LinkId=163185)。

Parameters

参数 必需 类型 说明

Identity

可选

Microsoft.SharePoint.PowerShell.SPAuthenticationProviderPipeBind

指定要获取的验证提供程序。

该类型必须是格式为 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;SharePoint 验证提供程序的有效名称(例如,NTLM);或者有效 SPAuthenticationProvider 对象的实例。

WebApplication

必需

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

返回指定的 Web 应用程序的内容数据库。

该类型必须是格式为 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;SharePoint Web 应用程序的有效名称(例如,MyOfficeApp1);或有效 SPWebApplication 对象的实例。

Zone

必需

Microsoft.SharePoint.Administration.SPUrlZone

指定要返回其验证提供程序的一个或多个 Web 应用程序区域。

该类型必须是下列任意一个有效区域:Default、Intranet、Internet、Extranet 或 Custom。

AssignmentCollection

可选

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

管理对象以便正确进行处理。使用 SPWebSPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。在使用 SPWebSPSiteSPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。

注意Note
在使用 Global 参数时,所有对象均包含在全局存储中。如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。

输入类型

返回类型

Example

-----------------示例 1-----------------

New-SPWebApplication http://sharepointonline.com -AuthenticationProvider (Get- SPAuthenticationProvider "LiveID STS")

此示例为新 Web 应用程序注册 LiveID STS 验证提供程序。

-----------------示例 2-----------------

New-SPWebApplication https://contoso.com -AuthenticationProvider (New- SPAuthenticationProvider -ASPNetMembershipProvider "myMembershipProvider" -ASPNetRoleProvider "myRoleProvider")

此示例为新 Web 应用程序注册 ASPNet。请注意,不会保留 ASPNET 成员关系,必须在每次使用时重新创建此关系。

-----------------示例 3-----------------

New-SPWebApplication https://contoso.com -AuthenticationProvider (Get- SPAuthenticationProvider "NTLM")

此示例为新 Web 应用程序注册 NTLM 验证提供程序。此命令等效于 New-SPWebApplication https://contoso.com 命令;NTLM 是默认验证提供程序。

-----------------示例 4-----------------

$ip = @( (Get- SPAuthenticationProvider "LiveID STS"), (New- SPAuthenticationProvider -ASPNetMembershipProvider "myMembershipProvider" -ASPNetRoleProvider "myRoleProvider"), (Get-SPAuthenticationProvider "NTLM")) )
New-SPWebApplication https://contoso.com -AuthenticationProvider $ip

此示例为新 Web 应用程序注册 NTLMASPNetLiveID STS 验证提供程序。

-----------------示例 5-----------------

New-SPWebApplication https://contoso.com -AuthenticationProvider (Get- SPAuthenticationProvider "Legacy NTLM")

此示例为新 Web 应用程序注册 Legacy NTLM 验证提供程序。

See Also

Reference

New-SPAuthenticationProvider