다음을 통해 공유


ConfiguredObject.GetAllSections 메서드1

구성된 개체 아래의 모든 구성 섹션을 검색합니다.

구문

ConfiguredObject.GetAllSections(Sections);  
ConfiguredObject.GetAllSections Sections  

매개 변수

속성 Description
Sections 구성된 개체의 구성 섹션이 복사되는 ConfigurationSection 변수입니다.

반환 값

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

설명

메서드는 GetAllSections 구성된 개체에 사용 가능한 섹션의 전체 집합을 검색하는 데 유용합니다. 일반 설정 및 구성 속성 가져오기는 ConfiguredObject.GetSection 메서드를 참조하세요.

참고

메서드 서명에는 GetAllSections 메서드가 [OUT] 반환하는 섹션을 수신하는 매개 변수가 포함되어 있습니다.

예제

다음 예제에서는 기본 웹 사이트의 Site 개체를 검색하고 메서드를 GetAllSections 사용하여 사이트의 구성 섹션 개체를 검색하고 열거합니다.

각 섹션의 instance 하나만 반환됩니다. 반환된 값은 사용 중인 ConfiguredObject 수준에 대한 유효 구성입니다. 반환된 모든 개체의 경로는 의 경로와 ConfiguredObject일치합니다.

참고

지정한 수준의 ConfiguredObject 개체만 반환됩니다.

' Connect to the WMI WebAministration namespace.  
Set oWebAdmin = _  
    GetObject("winmgmts:root\WebAdministration")  
  
' Get the default Web site.  
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")  
  
' Retrieve all configuration sections for the default Web  
' site and place them into an array variable.  
oSite.GetAllSections arySect  
  
' Display the number of configuration sections.  
WScript.Echo "There are " & UBound(arySect) + 1 & _  
    " configuration sections for [" & oSite.Name & "]."  
WScript.Echo vbCrLf  
  
' Iterate through the sections.  
For aryIdx = 0 To UBound(arySect)  
  
    ' Number the section for display.  
    WScript.Echo aryIdx + 1 & "."  
  
    ' Show the section name.  
    WScript.Echo "[" & arySect(aryIdx).Path_.Class & "]"  
  
    ' Show the section path and location.  
    WScript.Echo "Path: " & arySect(aryIdx).Path  
    WScript.Echo "Location: " & arySect(aryIdx).Location  
  
    ' Show the SectionInformation properties.  
    WScript.Echo "SectionInformation.OverrideMode: " & _  
        arySect(aryIdx).SectionInformation.OverrideMode  
    WScript.Echo _  
        "SectionInformation.EffectiveOverrideMode: " & _  
        arySect(aryIdx).SectionInformation.EffectiveOverrideMode  
    WScript.Echo "SectionInformation.IsLocked: " & _  
        arySect(aryIdx).SectionInformation.IsLocked  
    WScript.Echo "SectionInformation.LockItem: " & _  
        arySect(aryIdx).SectionInformation.LockItem  
  
    WScript.Echo vbCrLf  
Next  
  

요구 사항

형식 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

참고 항목

ConfiguredObject 클래스
ConfiguredObject.GetSection 메서드