Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

GroupPrincipal Class

Encapsulates group accounts. Group accounts can be arbitrary collections of principal objects or accounts created for administrative purposes.

System.Object
  System.DirectoryServices.AccountManagement.Principal
    System.DirectoryServices.AccountManagement.GroupPrincipal

Namespace:  System.DirectoryServices.AccountManagement
Assembly:  System.DirectoryServices.AccountManagement (in System.DirectoryServices.AccountManagement.dll)
[DirectoryRdnPrefixAttribute("CN")]
[DirectoryServicesPermissionAttribute(SecurityAction.InheritanceDemand, Unrestricted = true)]
[DirectoryServicesPermissionAttribute(SecurityAction.LinkDemand, Unrestricted = true)]
public class GroupPrincipal : Principal

The GroupPrincipal type exposes the following members.

  NameDescription
Public methodGroupPrincipal(PrincipalContext)Initializes a new instance of the GroupPrincipal class by using the specified context.
Public methodGroupPrincipal(PrincipalContext, String)Initializes a new instance of the GroupPrincipal class and assigns it to the specified context and SAM account name.
Top
  NameDescription
Public propertyContextGets a principal context that is associated with the principal. (Inherited from Principal.)
Protected propertyContextRawGets a principal context that is associated with this principal. (Inherited from Principal.)
Public propertyContextTypeGets the context type enumeraton value that specifies the type of principal context associated with this principal. (Inherited from Principal.)
Public propertyDescriptionGets or sets the description of the principal. (Inherited from Principal.)
Public propertyDisplayNameGets or sets the display name for this principal. (Inherited from Principal.)
Public propertyDistinguishedNameGets the distinguished name (DN) for this principal. (Inherited from Principal.)
Public propertyGroupScopeGets or sets a Nullable GroupScope enumeration that specifies the scope for this group principal.
Public propertyGuidGets the GUID associated with this principal. (Inherited from Principal.)
Public propertyIsSecurityGroupGets or sets a Nullable Boolean value that indicates whether the group is security-enabled.
Public propertyMembersGets a collection of principal objects that represent the members of the group.
Public propertyNameGets or sets the name of this principal. (Inherited from Principal.)
Public propertySamAccountNameGets or sets the SAM account name for this principal. (Inherited from Principal.)
Public propertySidGets the Security ID (SID) of the principal. (Inherited from Principal.)
Public propertyStructuralObjectClassGets the structural object class directory attribute. (Inherited from Principal.)
Public propertyUserPrincipalNameGets or sets the user principal name (UPN) associated with this principal. (Inherited from Principal.)
Top
  NameDescription
Protected methodCheckDisposedOrDeletedDetermines whether the Dispose or Delete methods have been called on this class. This method is called by classes that derive from this principal class. (Inherited from Principal.)
Public methodDeleteDeletes the principal object from the store. (Inherited from Principal.)
Public methodDisposeDisposes the current instance of the GroupPrincipal object. (Overrides Principal.Dispose().)
Public methodEqualsReturns a Boolean value that specifies whether the supplied object is equal to the current object. (Inherited from Principal.)
Protected methodExtensionGetRetrieves an attribute of an extended class object. (Inherited from Principal.)
Protected methodExtensionSetSets the value of an attribute in an extended class. (Inherited from Principal.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic memberFindByIdentity(PrincipalContext, String)Returns a group principal object that matches the specified identity value.
Public methodStatic memberFindByIdentity(PrincipalContext, IdentityType, String)Returns a group principal object that matches the specified identity type, and value. This version of the [Overlaod:System.DirectoryServices.AccountManagement.GroupPrincipal.FindByIdentity] method determines the format of the identity value.
Public methodGetGroups()Returns a collection of group objects that specify the groups of which the current principal is a member. (Inherited from Principal.)
Public methodGetGroups(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. (Inherited from Principal.)
Public methodGetHashCodeRetrieves the hash created from the contents of the principal object, suited for use in hashing algorithms and data structures like a hash table. (Inherited from Principal.)
Public methodGetMembers()Returns a collection of the principal objects that is contained in the group.
Public methodGetMembers(Boolean)Returns a collection of the principal objects that is contained in the group. When the recursive flag is set to true, this method searches the current group recursively and returns all nested group members.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetUnderlyingObjectReturns the underlying DirectoryEntry object that provides the contact data for the principal object. (Inherited from Principal.)
Public methodGetUnderlyingObjectTypeReturns the underlying object type. (Inherited from Principal.)
Public methodIsMemberOf(GroupPrincipal)Returns a Boolean value that specifies whether the principal is a member of the specified group. (Inherited from Principal.)
Public methodIsMemberOf(PrincipalContext, IdentityType, String)Returns a Boolean value that specifies whether the principal is a member of the group specified by identity type and value. (Inherited from Principal.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSave()Saves the changes that were made on the principal object to the store. If this is a new principal object, this method inserts it into the store. (Inherited from Principal.)
Public methodSave(PrincipalContext)Saves the changes that were made on the principal object to the store. If this is a new principal object, this method inserts it into the specified context. If the principal has already been persisted, it is moved from the original context to the specified context. (Inherited from Principal.)
Public methodToStringReturns a user friendly string representation of the current principal object. (Inherited from Principal.)
Top

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.