Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Gets users or groups that belong to the specified group. The specified group can be a Microsoft Windows security group, an ASP.NET role, or a SharePoint group.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
<DirectoryServicesPermissionAttribute(SecurityAction.Assert, Unrestricted := True)> _
Public Shared Function GetPrincipalsInGroup ( _
web As SPWeb, _
input As String, _
maxCount As Integer, _
<OutAttribute> ByRef reachedMaxCount As Boolean _
) As SPPrincipalInfo()
'Usage
Dim web As SPWeb
Dim input As String
Dim maxCount As Integer
Dim reachedMaxCount As Boolean
Dim returnValue As SPPrincipalInfo()
returnValue = SPUtility.GetPrincipalsInGroup(web, _
input, maxCount, reachedMaxCount)
[DirectoryServicesPermissionAttribute(SecurityAction.Assert, Unrestricted = true)]
public static SPPrincipalInfo[] GetPrincipalsInGroup(
SPWeb web,
string input,
int maxCount,
out bool reachedMaxCount
)
Parameters
web
Type: Microsoft.SharePoint.SPWebThe Web site for which the current user has the BrowseUserInfo permission.
input
Type: System.StringThe group to query for.
maxCount
Type: System.Int32The maximum number of members to return.
reachedMaxCount
Type: System.BooleanThe information about whether the maximum number of members has been reached.
Return value
Type: []
true if there are more members that were not returned; otherwise, false.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | The web or input parameter is a null reference (Nothing in Visual Basic). |
| ArgumentException | The maxCount parameter is less than 0. |