![]() |
|
||||
Using BatchExport FunctionBatch Export of All Addr-Type Objects in OrganizationThe following sample (which you may find in the Dir/BatchExport subdirectory in my set of samples) demonstrates how to dump 4 specific attributes for all Addr-Type objects in organization.#include <afxwin.h>
int main( void )
// Initialize BEXPORT_PARMS struct
// Specify which objects to export. This overrides
DAPI_EXPORT_ALL_CLASSES
// Specify attributes to export
avAttrName[0].DapiType = DAPI_STRING8;
avAttrName[2].DapiType = DAPI_STRING8;
avAttrName[3].DapiType = DAPI_STRING8;
// This terminates our attribute name array
DAPI_ENTRY deAttributes; deAttributes.unAttributes = 4;
// Do batch export operation
The file named "Dump.txt" may be found in Dir/BatchExport subdirectory
with the result of this export operation on my Exchange server. In my particular
case it contains 11 exported objects - 10 that came with default MS Exchange
installation, and one custom one - EDK:i386, which appeared after installation
of Microsoft's sample gateway.
Batch Export of the Whole Directory Tree in an OrganizationIf you'd like to export the contents of the whole tree, you may do it by using the following fragment (corresponding sample is called Dir/BatchExportAll):#include <afxwin.h>
int main( void )
// Initialize BEXPORT_PARMS struct
// Specify attributes to export
avAttrName[0].DapiType = DAPI_STRING8;
// This terminates our attribute name array
DAPI_ENTRY deAttributes; deAttributes.unAttributes = 2;
// Do batch export operation
This code exports only class names and distinguished names for all objects in the organization. Again, the result of the dump may be found together with source files. If you look into Dump.txt file in Dir/BatchExportAll sub-directory, you'll notice that most of its contents is occupied by Class-Schema and Attribute-Schema objects, and only a small fraction in the end - by real physical "instances" of them. This is because my test installation of MS Exchange is very small - it contains only a few mailboxes. The fragment above is different from the first one because I don't specify
class names here. In the first sample I have initialized rgpszClasses member
of BEXPORT_PARMS, thus telling that I specifically request Addr-Type objects
only. Also, the number of exported attributes is different - I have decided
for the sake of simplicity only export distinguished names (and class names).
If you want to export other attributes - you need to do extra work initializing
its pAttributes member.
|