Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Recupera el atributo allowLocation de una sección de configuración.
Sintaxis
ConfigurationSection.GetAllowLocation AllowLocation
ConfigurationSection.GetAllowLocation(AllowLocation);
Parámetros
| Nombre | Definición |
|---|---|
AllowLocation |
Variable string que recibe el atributo allowLocation que devuelve el método GetAllowLocation. Los valores de atributo posibles son "true" o "false". El valor predeterminado es "true". Nota: Este parámetro es string, no boolean. |
Valor devuelto
Este método no devuelve ningún valor.
Comentarios
El atributo allowLocation especifica si una sección de configuración puede aparecer dentro de un par de etiquetas de ubicación.
Dado que GetAllowLocation es un método estático, debe llamarlo obteniendo un objeto de clase, como en el ejemplo siguiente.
' Correct syntax:
Set oAnonAuth = oWebAdmin.Get("AnonymousAuthenticationSection")
oAnonAuth.GetAllowLocation strAnonAuthAllowLocation
Se produce un error en la sintaxis siguiente porque intenta llamar a GetAllowLocation en una instancia concreta de la clase Site. La llamada al método provocará un error de tipo "SWbemObjectEx: No encontrado".
' Incorrect syntax:
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "AnonymousAuthenticationSection", oAnonAuth
oAnonAuth.GetAllowLocation strAnonAuthAllowLocation
Ejemplo
En el ejemplo siguiente se muestra el atributo allowLocation de la sección de configuración de autenticación anónima.
' Get the WebAdministration namespace.
Set oWebAdmin = GetObject( _
"winmgmts:root\WebAdministration")
' Get the AnonymousAuthenticationSection.
Set oAnonAuth = oWebAdmin.Get( _
"AnonymousAuthenticationSection")
' Get the allowLocation attribute.
oAnonAuth.GetAllowLocation strAnonAuthAllowLocation
' Display the allowLocation attribute.
WScript.Echo _
"Anonymous Authentication Allow Location: " & _
strAnonAuthAllowLocation
Requisitos
| Tipo | Descripción |
|---|---|
| Remoto | - IIS 7.0 en Windows Vista - IIS 7.5 en Windows 7 - IIS 8.0 en Windows 8 - IIS 10.0 en Windows 10 |
| Server | - IIS 7.0 en Windows Server 2008 - IIS 7.5 en Windows Server 2008 R2 - IIS 8.0 en Windows Server 2012 - IIS 8.5 en Windows Server 2012 R2 - IIS 10.0 en Windows Server 2016 |
| Producto | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
| Archivo MOF | WebAdministration.mof |
Consulte también
AnonymousAuthenticationSection (clase)
ConfigurationSection (clase)
ConfigurationSection.GetAllowDefinition (método)