|
|
|
|
Dumping Attribute Names and Values for Directory ItemsI have showed previously how you can retrieve MS Exchange directory items with DAPI functions. The example presented there, however, did not show how you can traverse or dump to all this data to the screen. It would be a good idea to have a helper function which allows for that. This topic describes how this function may be written.Basically, all you need to do is call DAPIRead, obtain two DAPI_ENTRY pointers (one with attribute names and the other with their values), then traverse them and dump whatever you'll find to the screen. The following sample demonstrates how this may be accomplished. function DumpItemAttributes(pdeAttributes, pdeValues:PDAPI_ENTRY):TStrings; end; You may insert a call to this function after you have successfully called DAPIRead. It will conveniently dump all retrieved data to the screen. For the sake of experiment I have done this for my Addr-Type object and was amazed to see 50 (!) attributes dumped, many of them with no values (DAPI_NO_VALUE). However, important attributes such as "Obj-Dist-Name" (Object distinguished name), "Admin-Display-Name" and some others have been dumped with values that make sense. Anyway, using DAPI_READ_DEFINED_ATTRIBUTES for an Addr-Type object have returned 15 attributes to me, which is equal to what Exchange Admin lists when asked for raw properties. The only difference between Exchange Administrator output and that of the DumpItemAttributes function seems to be the Obj-Class attribute. Exchange Admin lists it as "Object-Class" which is obviously similar but not quite the same. Also, the value for Object-Class is binary and the dialog allows you to choose between two values there. Contrary to this, the Obj-Class attribute is text and the value is "Addr-Type". We have DELPHI Class that process reading and writing with DAPI.
|
|