Platform SDK: Active Directory, ADSI, and Directory Services |
The IADsGroup interface is designed to represent and manage group membership information in a directory service. It allows you to retrieve member objects, to test if a given object belongs to the group, and to add (or remove) an object to (or from) the group.
IADsGroup is a dual interface that inherits from IADs.
This interface exposes the following properties and methods.
IUnknown methods | Description |
---|---|
QueryInterface | Returns pointers to supported interfaces. |
AddRef | Increments reference count. |
Release | Decrements reference count. |
IDispatch methods | Description |
---|---|
GetTypeInfoCount | Gets the number of type descriptions. |
GetTypeInfo | Gets a description of object's programmable interface. |
GetIDsOfNames | Maps name of method or property to DISPID. |
Invoke | Calls one of the object's methods, or gets and sets one of its properties. |
IADsGroup properties and methods | Description |
---|---|
Description | Gets and sets the description of the group membership. |
Members | Gets an IADsMembers interface on the members object that is the collection of ADSI objects that represent the members of this group. |
IsMember | Tests for membership. |
Add | Adds an object to a group. |
Remove | Removes an object from a group. |
To create a group object, call GetObject(adspath), where adspath is the path to the group of interest. For example, you can bind to the Power Users group as shown in the following code snippet for the WinNT provider:
Dim group As IADsGroup Set group = GetObject("WinNT://Microsoft/Power Users")
The following code snippet works with the LDAP provider:
Dim group As IADsGroup Set group = GetObject("LDAP://CN=Power Users,DC=Microsoft,DC=com")
The following C++/C code snippet binds to the Power Users group through the WinNT provider.
IADsGroup *pGroup; HRESULT hr; LPWSTR adsPath = L"WinNT://Microsoft/Power Users"; hr = ADsGetObject(adsPath,IID_IADsGroup,(void**)&pGroup);
Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
Windows 95/98: Requires Windows 95 or later (with DSClient).
Header: Declared in Iads.h.