Skip to content

Latest commit

 

History

History
144 lines (92 loc) · 3.46 KB

iadsgroup-property-methods.md

File metadata and controls

144 lines (92 loc) · 3.46 KB
title description ms.assetid ms.tgt_platform keywords topic_type api_name api_location api_type ms.topic ms.date
IADsGroup Property Methods (Iads.h)
Property methods of the IADsGroup interface.
a8aa88d4-4695-47bc-bf7f-a17236a5671c
multiple
IADsGroup Property Methods ADSI
apiref
IADsGroup Property Methods
IADsGroup.Description
IADsGroup.get_Description
IADsGroup.put_Description
Activeds.dll
COM
reference
05/31/2018

IADsGroup Property Methods

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

Properties

Description

Indicates the textual description of the group membership.

Access type: Read/write

Scripting data type: BSTR

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

Remarks

Using IADsGroup to Retrieve Descriptions of Built-in Groups

The following examples show how to retrieve information about Windows group objects by name. In a multilingual environment, built-in groups are sometimes known by different localized names, which means that they cannot be retrieved directly by using string identifiers such as "WinNT://Microsoft/Administrators". In that case, the user can bind to the well-known SID object for the group, retrieve the localized group name, and supply that to the GetObject method. For more information, see Well-known SIDs.

Examples

The following Visual Basic example shows how to bind to a group object and display 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

The following C++ example shows how to bind to a group object and display 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("Description: %S\n",bstr);

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

    return hr;

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Iads.h
DLL
Activeds.dll
IID
IID_IADsGroup is defined as 27636B00-410F-11CF-B1FF-02608C9E7553

See also

IADs

IADsGroup

Interface Property Methods