ArcGIS Pro 2.7 API Reference Guide
GetGroupsFromUserAsync Method

ArcGIS.Desktop.Core Namespace > ArcGISPortalExtensions Class : GetGroupsFromUserAsync Method
The user whose community information will be queried
Gets the groups from the user's community information.
Syntax
public static Task<IReadOnlyList<PortalGroup>> GetGroupsFromUserAsync( 
   ArcGISPortal portal,
   string username
)
Public Shared Function GetGroupsFromUserAsync( _
   ByVal portal As ArcGISPortal, _
   ByVal username As String _
) As Task(Of IReadOnlyList(Of PortalGroup))

Parameters

portal
username
The user whose community information will be queried

Return Value

Exceptions
ExceptionDescription
Thrown when an invalid portal is provided as the active portal.
username cannot be null or empty
You do not have permissions to access this resource or perform this operation.
Request failed: status code {status code}
Remarks
Executes the following portal rest query:
{portalURL}sharing/rest/community/users/{userName}

Groups of the user are returned only to the user or the administrator of the user's organization. A user is not visible to any other user (except the organization's administrator) if their access setting is set to "private".
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

ArcGISPortalExtensions Class
ArcGISPortalExtensions Members