Platform SDK: Active Directory, ADSI, and Directory Services

IADsProperty Property Methods

The property methods of the IADsProperty interface read and write the properties described in the following table. For a general discussion of property methods, see Interface Property Methods.

Properties in Vtable Order

Property Description
OID

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_OID
([out] BSTR *bstrOID);


HRESULT put_OID
(
[in ]BSTR bstrOID);

Directory-specific object identifier.
Syntax

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_Syntax
([out] BSTR *bstrSyntax);

HRESULT put_Syntax
([in] BSTR bstrSyntax);

Relative path of syntax object.
MaxRange

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]

HRESULT get_MaxRange
([out] LONG *lnMaxRange);


HRESULT put_MaxRange
([in] LONG lnMaxRange);

Upper limit of values.
MinRange

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_MinRange
([out] LONG *lnMinRange);


HRESULT put_MinRange
([in] LONG lnMinRange);

Lower limit of values.
MultiValued

[Visual Basic]
Access: Read/Write
Data Type: VARIANT

[C++]
HRESULT get_MultiValues
([out] VARIANT *fMultivalued);


HRESULT put_MultiValues
([in] VARIANT fMultivalued);

Whether property supports single or multiple values.

Example Code [Visual Basic]

The following code snippet examines the OperatingSystem attribute of a computer on a network through the WinNT provider.

Dim obj As IADs
Dim cl As IADsClass
Dim pr As IADsProperty
Dim sc As IADsContainer
 
Set obj = GetObject("WinNT://myMachine,computer")
Set cl = GetObject(obj.Schema)
Set sc = GetObject(cl.Parent)
Set pr = sc.GetObject("Property","OperatingSystem")
 
MsgBox "Attribute:  " & pr.Name
MsgBox "Syntax:     " & pr.Syntax
MsgBox "MaxRange:   " & pr.MaxRange
MsgBox "MinRange:   " & pr.MinRange
MsgBox "Multivalued:" & pr.Multivalued

Example Code [C++]

The following code snippet examines the OperatingSystem attribute of a computer on a network through the WinNT provider. For brevity, error checking is omitted.

IADs *pADs;
IADsClass *pCls;
IADsProperty* pProp;
IADsContainer *pCont;
long lval;
short bval;
HRESULT hr = CoInitialize(NULL);
 
hr = ADsGetObject(L"WinNT://myMachine,computer",
                  IID_IADs, (void**)&pADs);
BSTR bstr;
pADs->get_Schema(&bstr);
pADs->Release();
hr = ADsGetObject(bstr, IID_IADsClass, (void**)&pCls);
pCls->get_Parent(&bstr);
pCls->Release();
hr = ADsGetObject(bstr, IID_IADsContainer, (void**)&pCont);
pCont->GetObject(L"Property", L"OperatingSystem",(IDispatch**)&pProp);
pCont->Release();
pProp->get_Name(&bstr);
printf(" Name : %S\n",bstr);
pProp->get_Syntax(&bstr);
printf(" Syntax : %S\n",bstr);
pProp->get_MaxRange(&lval);
printf(" MaxRange : %d\n",lval);
pProp->get_MinRange(&lval);
printf(" MinRange : %d\n", lval);
pProp->get_Multivalued(&bval);
printf(" MultiValued : %b\n",bval);
 
CoUninitialize();

See Also

IADsClass, IADsProperty, IADsSyntax