다음을 통해 공유


ConfigurationSection.SetAllowLocation 메서드

구성 섹션의 allowLocation 특성을 설정합니다.

구문

ConfigurationSection.SetAllowLocation(AllowLocation)  
ConfigurationSection.SetAllowLocation(AllowLocation);  

매개 변수

이름 정의
AllowLocation 구성 섹션의 allowLocation 특성을 설정하는 대/소문자를 구분 string 하는 변수입니다. 가능한 특성 값은 "true" 또는 "false"입니다. 기본값은 "true"입니다. 참고: 이 매개 변수는 가 string아닌 입니다 boolean.

반환 값

이 메서드는 값을 반환하지 않습니다.

설명

특성은 allowLocation 구성 섹션이 위치 태그 쌍 내에 나타날 수 있는지 여부를 지정합니다.

SetAllowLocation 정적 메서드이므로 다음 예제와 같이 클래스 개체를 가져오면 호출해야 합니다.

' Correct syntax:  
Set oAnonAuth = oWebAdmin.Get("AnonymousAuthenticationSection")  
oAnonAuth.SetAllowLocation "false"  

클래스의 구체적인 instance 호출 SetAllowLocation 하려고 하므로 다음 구문이 Site 실패합니다. 메서드를 호출하면 "SWbemObjectEx: 찾을 수 없음" 오류가 발생합니다.

  
' Incorrect syntax:  
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")  
oSite.GetSection "AnonymousAuthenticationSection", oAnonAuth  
oAnonAuth.SetAllowLocation "false"  

예제

다음 예제에서는 익명 인증 구성 섹션에 대한 특성을 설정합니다 allowLocation .

' Get the WebAdministration namespace.  
Set oWebAdmin = GetObject( _  
    "winmgmts:root\WebAdministration")  
  
' Get the AnonymousAuthenticationSection.  
Set oAnonAuth = oWebAdmin.Get( _  
    "AnonymousAuthenticationSection")  
  
' Set the allowLocation attribute.  
oAnonAuth.GetAllowLocation "false"  
  

요구 사항

형식 Description
클라이언트 - Windows Vista의 IIS 7.0
- Windows 7의 IIS 7.5
- Windows 8의 IIS 8.0
- WINDOWS 10 IIS 10.0
서버 - Windows Server 2008의 IIS 7.0
- Windows Server 2008 R2의 IIS 7.5
- Windows Server 2012의 IIS 8.0
- Windows Server 2012 R2의 IIS 8.5
- WINDOWS SERVER 2016 IIS 10.0
제품 - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
MOF 파일 WebAdministration.mof

참고 항목

AnonymousAuthenticationSection 클래스
ConfigurationSection 클래스
ConfigurationSection.GetAllowLocation 메서드