IGPM::GetSitesContainer method

Creates and returns a GPMSitesContainer object from which sites can be opened and queried.


HRESULT GetSitesContainer(
  BSTR               bstrForest,
  BSTR               bstrDomain,
  BSTR               bstrDomainController,
  long               lDCFlags,
  IGPMSitesContainer **ppIGPMSitesContainer



Required. Full DNS name of the forest in which to access sites; this is the name of the forest root domain. Use null-terminated string.


Name of the domain in which to access sites. If specified, this must be a full Domain Name Server (DNS) name, such as example.microsoft.com. If a domain is specified in the bstrDomain parameter, the Group Policy Management Console (GPMC) accesses sites through that domain. If no domain is specified, the GPMC accesses the sites through the forest that is specified in the bstrForest parameter. Use a null-terminated string.


If specified, the name of the domain controller to use with the domain specified in the bstrDomain parameter. The name can be a DNS name or a NetBIOS name. Otherwise, the method uses the primary domain controller (PDC). Use a null-terminated string.


Flags to use to locate the domain controller for the domain. Currently, the only supported value is GPM_USE_ANYDC. If this parameter is set to zero, and bstrDomainController is specified, the method uses the specified domain controller. Otherwise, the method uses the PDC.


Address of a pointer to the IGPMSitesContainer interface.

Return Value


Returns S_OK if successful. Returns a failure code if an error occurs.


Returns a reference to a GPMSitesContainer object.


Returns a reference to a GPMSitesContainer object.


Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header gpmgmt.h
DLL Gpmgmt.dll

See Also