在 Windows Server 数据中心找不到 WebAdministration powershell 模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5963647/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 08:22:27  来源:igfitidea点击:

WebAdministration powershell module not found on windows server data center

windowspowershell

提问by Jeevan

In Windows Server 2008 Datacenter, I could not find the PowerShell webadministrationmodule. I tried Get-PSSnapinand Get-Module -ListAvailable, neither of which showed webadministration

在 Windows Server 2008 Datacenter 中,我找不到 PowerShellwebadministration模块。我试过Get-PSSnapinGet-Module -ListAvailable,都没有显示webadministration

And I don't see the webadministrationmodule under the directory %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules!!

而且我没有看到webadministration目录下的模块%SystemRoot%\system32\WindowsPowerShell\v1.0\Modules!!

Do I need to install or enable something to have webadministrationon Datacenter ?

我需要webadministration在 Datacenter 上安装或启用某些东西吗?

回答by ravikanth

You need to have web server role (IIS) installed. WebAdministration is a module. So, use Get-Module -ListAvailable

您需要安装 Web 服务器角色 (IIS)。WebAdministration 是一个模块。所以,使用Get-Module -ListAvailable

Also, looks like these cmdlets are available only on Windows Server 2008 R2 or with IIS 7.5. So, if you have IIS7.5 on Windows Server 2008, these cmdlets will be available.

此外,看起来这些 cmdlet 仅在 Windows Server 2008 R2 或 IIS 7.5 上可用。因此,如果您在 Windows Server 2008 上安装了 IIS7.5,则这些 cmdlet 将可用。

回答by Richard Nienaber

You can install the snapin. You can then use this scriptto load it.

您可以安装管理单元。然后,您可以使用此脚本加载它。

回答by SliverNinja - MSFT

For automation with Windows Server 2008, We use WebPiCmdto push IISPowershellSnapin, then run Add-PSSnapin WebAdministrationto support IIS powershell integration. The IIS Administration Module is already present in Windows Server 2012by default.

对于Windows Server 2008 的自动化,我们使用WebPiCmd推送IISPowershellSnapin,然后运行Add-PSSnapin WebAdministration以支持 IIS powershell 集成。默认情况下,IIS 管理模块已存在于Windows Server 2012 中

Powershell - Support IIS Administration for Server 2008

Powershell - 支持 Server 2008 的 IIS 管理

.\WebpiCmd.exe /Install /Products:IISPowershellSnapin /AcceptEula /ForceReboot
Add-PSSnapin WebAdministration
Get-Website