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;
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;
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