Article ID: 186334
Article Last Modified on 7/1/2004
typedef struct _BackupListNode
{
struct _BackupListNode __RPC_FAR *pnodeNext;
struct _BackupListNode __RPC_FAR *pnodeChildren;
RPC_SZ szName;
} BackupListNode;
//Program Start
/*******************************************************************
// This code returns a BackupListNode structure that
// represents the Organizational Hierarchy of Exchange.
//******************************************************************
#define UNICODE
#define _UNICODE
#include <SADAPI.H> //this header is included in the Platform SDK
#include <TCHAR.h>
void main(void)
{
BackupListNode* pNode = NULL;
RPC_SC sc;
PRPCBINDINFO pBindInfo = new RPCBINDINFO;
TCHAR wszServer[256];
ZeroMemory(pBindInfo, sizeof(RPCBINDINFO));
// Replace "ExchangeServer" with the server name you
// want to get the hierarchy from
_tcscpy(wszServer, L"ExchangeServer");
sc = SAD_ScBind(pBindInfo, wszServer);
if (sc != ERROR_SUCCESS) return;
sc = SAD_ScGetBackupListNodeW(pBindInfo->wszServer, &pNode);
// pNode will contain your entire hierarchy as seen by
// the Server (wszServer)
SAD_FreeBackupListNode(pNode);
SAD_Unbind(pBindInfo);
delete pBindInfo;
}
To build use the following Libraries:
Additional query words: kbDSupport kbEDK kbMsg
Keywords: kbhowto KB186334