Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetGroups Method

Principal.GetGroups Method

Returns a collection of group objects that specify the groups of which the current principal is a member.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method GetGroups() Returns a collection of group objects that specify the groups of which the current principal is a member.
Public method GetGroups(PrincipalContext) Returns a collection of group objects that the principal is a member of and that exist in the store provided by the specified context parameter.
Top

This overloaded method only returns the groups of which the principal is directly a member; no recursive searches are performed. Recursive search results are available for user principal objects. For more information, see the GetAuthorizationGroups method.

If the principal store is AD DS, the list of groups contains the user's primary group that is identified by the primary group ID attribute in the AD DS object.

Show:
© 2015 Microsoft