| title | IAppHostAdminManager::GetAdminSection Method |
|---|---|
| description | Describes the IAppHostAdminManager::GetAdminSection method and details its syntax, parameters, return value, remarks, code example, and requirements. |
| ms.date | 10/07/2016 |
| ms.assetid | 9b611373-5022-0372-942f-4825a8bc3bd3 |
Gets an [!INCLUDEiisver] configuration section that has the requested name and configuration path.
HRESULT GetAdminSection(
[in,
string] BSTR bstrSectionName,
[in,
string] BSTR bstrPath,
[out,
retval] IAppHostElement** ppAdminSection
); bstrSectionName
A BSTR that contains the path to a valid section name in the configuration system.
bstrPath
A BSTR that contains the configuration system path.
ppAdminSection
A pointer to a pointer for an IAppHostElement interface.
An HRESULT. Possible values include, but are not limited to, those in the following table.
| Value | Description |
|---|---|
| S_OK | Indicates that the operation was successful. |
| ERROR_INVALID_DATA | Indicates that the data is invalid. |
| ERROR_FILE_NOT_FOUND | Indicates that the requested path was not found. |
| ERROR_INVALID_PARAMETER | Indicates that a parameter is incorrect. |
| E_ACCESSDENIED | Indicates that the operation was not successful because of access restrictions. |
For a specified configuration path, the return values of this method represent the corresponding values in the hierarchically merged configuration set. To set the configuration path, use the bstrPath parameter of this method.
The following code example uses the IAppHostAdminManager interface to obtain all merged child elements for the system.webServer/asp configuration section in the MACHINE/WEBROOT/APPHOST configuration path.
[!code-cppIAppHostAdminLibrary#1]
| Type | Description |
|---|---|
| Client | - IIS 7.0 on [!INCLUDEwinvista] - IIS 7.5 on Windows 7 - IIS 8.0 on Windows 8 - IIS 10.0 on Windows 10 |
| Server | - IIS 7.0 on [!INCLUDEwinsrv2008] - IIS 7.5 on Windows Server 2008 R2 - IIS 8.0 on Windows Server 2012 - IIS 8.5 on Windows Server 2012 R2 - IIS 10.0 on Windows Server 2016 |
| Product | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 - [!INCLUDEiisexp75], [!INCLUDEiisexp80], [!INCLUDEiisexp100] |
| Header | Ahadmin.h |
IAppHostAdminManager Interface
IAppHostConfigFile::GetAdminSection Method