Inherited from
Applies to Objects
This is the primary interface of the Group and Local Group objects. You can use this interface to get or set group properties, and to add or remove users to or from groups. It also provides a method to check whether a given user is a member of a group or not.
Property/Method |
Description |
Gets the Security object for managing permissions for the Group. |
|
Adds a new member to a group, usually a user or another global group (in case of local group) |
|
Gets the numbers of members of this group |
|
Gets and sets the text Description of a group |
|
Gets and sets the Filter |
|
Returns the array of task names assigned to this group in the given domain |
|
Checks whether a given user is a member of a group |
|
Returns a collection of Ads objects that represent the members of a group |
|
Removes a member from a group, usually a user or another global group (in case of a local group) |
|
Renames a group with a specified name |
Example
This example demonstrates the use of IADsGroup Properties and
Methods.
Dim Group as IADsGroup
'Bind to the known NT Group object.
'Here MSFT is your domain name and Zoo is name of a Group in
MSFT.
Set Group = GetObject("NTDS://MSFT/Zoo")
'Debug.Print to print the name, Description etc. to the debug
window.
'Here you can use Name property as IADsGroup is derived from
IADs.
Debug.Print Group.Name
Debug.Print Group.Description
'Change the Description of the Group.
Group.Description = "New Description"
'Call SetInfo to commit the changes to the network.
'You could do this only if you have privileges for this
operation.
Group.SetInfo
'Now refresh the ADS object cache with a GetInfo call.
Group.GetInfo
'Display Description.
Debug.Print Group.Description
'Add User Named Jane in to this group.
'Jane must be present in the Domain MSFT.
Group.Add("Jane")