Principal.GetGroups Method

 

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

Namespace:   System.DirectoryServices.AccountManagement
Assembly:  System.DirectoryServices.AccountManagement (in System.DirectoryServices.AccountManagement.dll)

NameDescription
System_CAPS_pubmethodGetGroups()

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

System_CAPS_pubmethodGetGroups(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.

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.

System.DirectoryServices.AccountManagement
GetGroups
Principal Class
System.DirectoryServices.AccountManagement Namespace Overview

Return to top
Show: