Working with DAPIGetSiteInfo Function
The DAPIGetSiteInfo function retrieves the site
information for a directory service agent.
The DAPIGetSiteInfo function not need starting DAPI
Session.
Some of returned information from this function can be passed as argumentts in DAPI_PARMS
strucure. This will be increase speed of establishing DAPI Session.
Declaration:
function DAPIGetSiteInfoA(
dwFlags: DWORD;
pszDSA: PChar;
out ppSiteInfo: PSITE_INFOA
): PDAPI_EVENTA;stdcall;
Parameters
- dwFlags
- Input parameter. Reserved for future use. Must be 0.
- pszDSA
- Input parameter. Points to the name of the directory service agent
(Microsoft Exchange Server name) from which to retrieve information. Use Nil
for local computer.
- ppSiteInfo
- Output parameter. Points to a SITE_INFO
structure.
Return Values
- Nil
- No errors were encountered.
- or
- A pointer to a DAPI_EVENT structure
- An error was encountered.
The SITE_INFO structure contains
information about a site.
Declaration (in DAPI.pas)
type
PSITE_INFOA = ^SITE_INFOA;
SITE_INFOA = record
pszCountry : PChar;
// Country code
objServer : NAME_INFOA;
// Name information for server
objSite : NAME_INFOA; // Name information for site containing server
objEnterprise : NAME_INFOA; // Name information for enterprise containing server
end;
SITE_INFO = SITE_INFOA;
PSITE_INFO = PSITE_INFOA;
Members
- pszCountry
- Country code. Parsed from X400 value of Site-Proxy-Space attribute on
Site-Addressing object.
- objServer
- Name information for server.
- objSite
- Name information for site containing server.
- objEnterprise
- Name information for organization containing server.
With we can retrieve the common name, distinguished name, and
display name of objects (Exchange Server, Exchange Site and Exchange
Organization).
The EDK for DELPHI 5 Include Class named TSiteInfo:
TSiteInfo =
class
private
...
...
procedure ReportDapiEvent(DapiEvent: PDAPI_EVENT);stdcall;
procedure RaiseDAPIError(DapiEvent: PDAPI_EVENT);stdcall;
public
constructor Create(const DSAName:string);
destructor Destroy;override;
function GetInfo: boolean;
procedure OnError(ErrorNo:ULONG; ErrMessage: String);
property Items:TStrings read FItems;
property Exicuted: boolean read FExicuted;
property Country:String read FCountry;
property SrvName:String read FServerName;
property SrvDNString:String read FServerDNString;
property SrvDisplayName:String read FServerDisplayName;
property SiteName:String read FSiteName;
property SiteDNString:String read FSiteDNString;
property SiteDisplayName:String read FSiteDisplayName;
property OrganizationName:String read FEnterpriseName;
property OrganizationDNString:String read FEnterpriseDNString;
property OrganizationDisplayName:String read FEnterpriseDisplayName;
end;
Sample DELPHI Application for
using DAPIGetSiteInfo and DAPI_EVENT structure
|