| title | IAppHostConfigFile::GetAdminSection Method |
|---|---|
| description | Describes the IAppHostConfigFile::GetAdminSection method and details its parameters, return value, code example, and requirements. |
| ms.date | 10/07/2016 |
| ms.assetid | 83c44f92-2b3a-ee32-3bd3-34ae9284d12d |
Gets a configuration section for a given configuration section and configuration path.
HRESULT GetAdminSection(
[in,
string] BSTR bstrSectionName,
[in,
string] BSTR bstrPath,
[out,
retval] IAppHostElement** ppAdminSection
); bstrSectionName
A BSTR that contains the name of the requested section.
bstrPath
A BSTR that contains the requested configuration 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 section contains invalid data. |
The following code example demonstrates how to use the GetAdminSection method to obtain a reference to the system.webServer/defaultDocument configuration section in the MACHINE/WEBROOT/APPHOST configuration path.
[!code-cppIAppHostAdminLibrary#5]
| 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 |