DirectoryBrowseSection クラス
IIS でディレクトリの参照を構成します。
構文
class DirectoryBrowseSection : ConfigurationSection
メソッド
次の表に、DirectoryBrowseSection
クラスによって公開されるメソッドの一覧を示します。
名前 | 説明 |
---|---|
GetAllowDefinition | (ConfigurationSection から継承。) |
GetAllowLocation | (ConfigurationSection から継承。) |
RevertToParent | (ConfigurationSection から継承。) |
SetAllowDefinition | (ConfigurationSection から継承。) |
SetAllowLocation | (ConfigurationSection から継承。) |
プロパティ
次の表は、DirectoryBrowseSection
クラスによって公開されるプロパティの一覧です。
名前 | 説明 |
---|---|
Enabled |
読み取り/書き込みの boolean 値。 IIS 内のディレクトリに対してディレクトリの参照を有効にする場合は true 。それ以外の場合は false 。 既定値は、false です。 |
Location |
(ConfigurationSection から継承。)キー プロパティ。 |
Path |
(ConfigurationSection から継承。)キー プロパティ。 |
SectionInformation |
(ConfigurationSection から継承。) |
ShowFlags |
参照ディレクトリ内のファイル情報の表示を構成するマスクを含む sint32 値。 使用できる値の一覧は、後述の「注釈」セクションに示します。 |
サブクラス
このクラスにはサブクラスが含まれていません。
解説
IIS のディレクトリに対してディレクトリの参照が有効になっている場合、次の条件に該当すれば、ユーザーはディレクトリのコンテンツを一覧表示するページを受け取ります。
ユーザーは URL にファイルを指定しません (たとえば、ユーザーは
http://www.contoso.com/default.htm)
ではなくhttp://www.contoso.com/
にアクセスします)。IIS で既定のドキュメントが無効になっているか、IIS の既定のドキュメント リストで指定された名前と一致するファイルがディレクトリ内で見つからない。
Note
既定では、ユーザーがディレクトリのコンテンツを表示できないように、IIS ではディレクトリの参照が無効になっています。 セキュリティを強化するために、Web 分散オーサリングとバージョン管理 (WebDAV) を使用して HTTP 経由でファイルを共有するなど、有効にする特定の理由がない限り、ディレクトリの参照は無効のままにする必要があります。 ディレクトリの参照を有効にする場合は、共有する特定の単一または複数のディレクトリでのみ有効にしてください。
次の表に、ShowFlags
プロパティとして使用できる値の一覧を示します。 既定値は、2 (Date
)、4 (Time
)、8 (Size
)、16 (Extension
) です。
Value | キーワード | 説明 |
---|---|---|
0 | None |
拡張子なしのファイル名を表示します。 他のフラグが既に指定されている場合、このフラグは無効です。 |
2 | Date |
各ファイルの最終変更日。 |
4 | Time |
各ファイルの最終変更時刻。 |
8 | Size |
各ファイルのサイズ。 |
16 | Extension |
ファイル名の後のファイル拡張子。 |
32 | LongDate |
各ファイルの拡張形式の最終変更日。 |
例
次の例では、既定の Web サイトの DirectoryBrowseSection
クラスのプロパティを表示します。
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = _
GetObject("winmgmts:root\WebAdministration")
Set oService = GetObject("winmgmts:root\WebAdministration")
' Get the directory browse section of the default Web site.
Set oSite = oService.Get("Site.Name='Default Web Site'")
oSite.GetSection "DirectoryBrowseSection", oSection
' Display the properties.
WScript.Echo "DirectoryBrowseSection Properties"
WScript.Echo "---------------------------------"
WScript.Echo "Path: " & oSection.Path
WScript.Echo "Location: " & oSection.Location
WScript.Echo "Enabled: " & oSection.Enabled
WScript.Echo "ShowFlags: " & oSection.ShowFlags
WScript.Echo
WScript.Echo "DirectoryBrowseSection.SectionInformation"
WScript.Echo "-----------------------------------------"
WScript.Echo "OverrideMode: " & oSection.SectionInformation.OverrideMode
WScript.Echo "EffectiveOverrideMode: " & oSection.SectionInformation.EffectiveOverrideMode
WScript.Echo "IsLocked: " & _
oSection.SectionInformation.IsLocked
WScript.Echo "LockItem: " & _
oSection.SectionInformation.LockItem
継承階層
DirectoryBrowseSection
要件
型 | 説明 |
---|---|
クライアント | - 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 |
Product | - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0 |
MOF ファイル | WebAdministration.mof |