IADsProperty Property Methods
The property methods of the IADsProperty interface read and write the properties described in the following table. For more information about property methods, see Interface Property Methods.
Properties
-
MaxRange
-
-
Access type: Read/write
-
Scripting data type: LONG
-
// C++ method syntax HRESULT get_MaxRange( [out] LONG* lnMaxRange ); HRESULT put_MaxRange( [in] LONG lnMaxRange );
Upper limit of values.
-
-
MinRange
-
-
Access type: Read/write
-
Scripting data type: LONG
-
// C++ method syntax HRESULT get_MinRange( [out] LONG* lnMinRange ); HRESULT put_MinRange( [in] LONG lnMinRange );
Lower limit of values.
-
-
MultiValued
-
-
Access type: Read/write
-
Scripting data type: VARIANT_BOOL
-
// C++ method syntax HRESULT get_MultiValued( [out] VARIANT_BOOL* fMultivalued ); HRESULT put_MultiValued( [in] VARIANT_BOOL fMultivalued );
Whether property supports single or multiple values.
-
-
OID
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_OID( [out] BSTR* bstrOID ); HRESULT put_OID( [out] BSTR* bstrOID );
Directory-specific object identifier.
-
-
Syntax
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Syntax( [out] BSTR* bstrSyntax ); HRESULT put_Syntax( [in] BSTR* bstrSyntax );
Relative path of syntax object.
-
Examples
The following code example 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
On Error GoTo Cleanup
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
Cleanup:
If (Err.Number<>0) Then
MsgBox("An error has occurred. " & Err.Number)
End If
Set obj = Nothing
Set cl = Nothing
Set pr = Nothing
Set sc = Nothing
The following code example examines the OperatingSystem attribute of a computer on a network through the WinNT provider. For brevity, error checking is omitted.
IADs *pADs = NULL;
IADsClass *pCls = NULL;
IADsProperty* pProp = NULL;
IADsContainer *pCont = NULL;
long lval;
short bval;
HRESULT hr = CoInitialize(NULL);
hr = ADsGetObject(L"WinNT://myMachine,computer",
IID_IADs, (void**)&pADs);
if(FAILED(hr))
goto Cleanup;
BSTR bstr;
hr = pADs->get_Schema(&bstr);
if(FAILED(hr))
goto Cleanup;
hr = ADsGetObject(bstr, IID_IADsClass, (void**)&pCls);
hr = pCls->get_Parent(&bstr);
if(FAILED(hr))
goto Cleanup;
hr = ADsGetObject(bstr, IID_IADsContainer, (void**)&pCont);
if(FAILED(hr))
goto Cleanup;
SysFreeString(bstr);
hr = pCont->GetObject(CComBSTR("Property"), CComBSTR("OperatingSystem"), (IDispatch**)&pProp);
if(FAILED(hr))
goto Cleanup;
hr = pProp->get_Name(&bstr);
if(FAILED(hr))
goto Cleanup;
printf(" Name : %S\n",bstr);
SysFreeString(bstr);
hr = pProp->get_Syntax(&bstr);
if(FAILED(hr))
goto Cleanup;
printf(" Syntax : %S\n",bstr);
SysFreeString(bstr);
hr = pProp->get_MaxRange(&lval);
if(FAILED(hr))
goto Cleanup;
printf(" MaxRange : %d\n",lval);
SysFreeString(bstr);
hr = pProp->get_MinRange(&lval);
if(FAILED(hr))
goto Cleanup;
printf(" MinRange : %d\n", lval);
SysFreeString(bstr);
hr = pProp->get_Multivalued(&bval);
if(FAILED(hr))
goto Cleanup;
printf(" MultiValued : %b\n",bval);
SysFreeString(bstr);
Cleanup:
if(pADs)
pADs->Release();
if(pCls)
pCls->Release();
if(pCont)
pCont->Release();
if(pProp)
pProp->Release();
CoUninitialize();
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows Vista |
Minimum supported server |
Windows Server 2008 |
Header |
|
DLL |
|
IID |
IID_IADsProperty is defined as C8F93DD3-4AE0-11CF-9E73-00AA004A5691 |
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for