gpt4 book ai didi

powershell - 如何确定Powershell中站点,应用程序和文件夹级别的IIS中的目录浏览是否已打开

转载 作者:行者123 更新时间:2023-12-03 01:10:46 25 4
gpt4 key购买 nike

我第一次被要求提供一个功能强大的查询,以确定是否在IIS中打开了目录浏览功能。我发现,不仅可以在站点级别启用目录浏览,还可以在应用程序级别或Web服务级别启用目录浏览。

这对我来说有点先进。
有人知道这是怎么回事吗?

谢谢

最佳答案

您可以使用powershell IIS Snapin,以下示例将获取默认网站的值:

Get-WebConfigurationProperty -filter /system.webServer/directoryBrowse -name enabled -PSPath 'IIS:\Sites\Default Web Site'
ItemXPath : /system.webServer/directoryBrowse
IsInheritedFromDefaultValue : False
IsProtected : False
Name : enabled
TypeName : System.Boolean
Schema : Microsoft.IIs.PowerShell.Framework.ConfigurationAttributeSchema
Value : False
IsExtended : False

关于powershell - 如何确定Powershell中站点,应用程序和文件夹级别的IIS中的目录浏览是否已打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39707868/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com