简体   繁体   English

通过Powershell获取IIS7.5详细信息

[英]Getting IIS7.5 details through Powershell

$iis=Get-WmiObject -namespace root/MicrosoftIISv2 -query "select * from iiswebservicesetting whe re name='W3SVC'" $ iis = Get-WmiObject-命名空间root / MicrosoftIISv2 -query“从iiswebservicesetting中选择*,名称为'W3SVC'”

OR 要么

$iis = Get-WmiObject -namespace root/MicrosoftIISv2 -class IIsWebServiceSetting $ iis = Get-WmiObject-命名空间root / MicrosoftIISv2 -class IIsWebServiceSetting

The above as worked very well for me in case of IIS6.0. 在IIS6.0的情况下,以上对我来说非常有效。 But in case of IIS7.5 the namespace is root\\WebAdministration. 但是对于IIS7.5,名称空间是root \\ WebAdministration。 I am not sure what query i need to run to get the data that i used to obtain when i ran the WMI command for IIS6.0.You can also tell me the class that i need to use. 我不确定运行IIS6.0的WMI命令时需要运行哪个查询来获取用于获取数据的数据。您还可以告诉我需要使用的类。

2) i need to get some information for IIS ASP.Net configuration. 2)我需要获取有关IIS ASP.Net配置的一些信息。 The .NET Framework defines a set of elements that implement configuration settings, and the ASP.NET configuration schemacontains elements that control how ASP.NET Web applications behave. .NET Framework定义了一组用于实现配置设置的元素,而ASP.NET配置架构包含控制ASP.NET Web应用程序行为的元素。

I need to get Details like SessionState,Authorisation,authentication mode,compilation etc 我需要获取诸如SessionState,Authorisation,身份验证模式,编译等详细信息

I need to know which NAMESPACE i should use and WHICH CLASS within this namespace i need to use. 我需要知道我应该使用哪个名称空间以及我需要使用的命名空间中的WHICH CLASS。

Please anyone help me with above 2 problems as its very much needed for me to move ahead with my work. 请任何人帮助我解决上述两个问题,因为这是我继续开展工作所非常需要的。

Thanks in advance 提前致谢

You should have a look at the PowerShell Module for Web Administration for IIS 7.5. 您应该查看用于IIS 7.5的Web管理PowerShell模块。 On a 2008R2 box running IIS, run the following commands and see what you can find. 在运行IIS的2008R2机器上,运行以下命令,然后查看可以找到的内容。

PS> Import-Module WebAdministration
PS> Get-Command -module WebAdministration

There is also an IIS provider. 还有一个IIS提供程序。 You can cd into IIS:\\ and use get-item/set-item cmdlets. 您可以使用cd进入IIS:\\并使用get-item / set-item cmdlet。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM