大网数据广告活动
域与目录服务

IADsGroup Property Methods (Iads.h)

· 52CE 我爱测

Property methods of the IADsGroup interface.

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

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。