Directory Services

IADsGroup Property Methods

The property methods of the IADsGroup interface read and write the following properties. For more information, see Interface Property Methods.

Properties

Property Description
Description

[Visual Basic]
Access: Read/Write
DataType: BSTR

[C++]
HRESULT get_Description
([out] BSTR* pbstrDescription);
HRESULT put_Description
([in] BSTR bstrDescription);

Indicates the textual description of the group membership.

Example Code [Visual Basic]

The following code example binds to a group object and displays the description of the group.

Dim grp As IADsGroup
On Error GoTo Cleanup

Set grp = GetObject("WinNT://Microsoft/Administrators")
Debug.Print grp.Description

Cleanup
	If (Err.Number<>0) Then
		MsgBox("An error has occurred. " & Err.Number)
	End If
	Set grp = Nothing

Example Code [C++]

The following code example binds to a group object and displays the description of the group.

IADsGroup *pGroup = NULL;
HRESULT hr = S_OK;
LPWSTR adsPath = L"WinNT://localHost/Administrators";
BSTR bstr;

hr = ADsGetObject(adsPath,IID_IADsGroup,(void**)&pGroup);

if(FAILED(hr)) {goto Cleanup;}

hr = pGroup->get_Description(&bstr);
if(FAILED(hr)) {goto Cleanup;}

printf("Descripton: %S\n",bstr);

Cleanup:
	SysFreeString(bstr);
	if(pGroup) 
		pGroup->Release();

	return hr;

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.

See Also

IADs, IADsGroup, Interface Property Methods