Platform SDK: Active Directory, ADSI, and Directory Services |
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.
Property | Description |
---|---|
OID
[Visual Basic] [C++] |
Directory-specific object identifier. |
Syntax
[Visual Basic] [C++]
|
Relative path of syntax object. |
MaxRange
[Visual Basic] [C++]
|
Upper limit of values. |
MinRange
[Visual Basic] [C++] |
Lower limit of values. |
MultiValued
[Visual Basic] [C++] |
Whether property supports single or multiple values. |
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
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();