Windows Web Server 2008 R2中不包含Powershell Servermanager模块

这让我疯狂!

显然使用servermanager模块应该像input一样简单:

Import-Module servermanager 

问题是我没有它。

 PS C:\Users\Administrator> Get-Module -ListAvailable Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules ModuleType Name ExportedCommands ---------- ---- ---------------- Manifest BitsTransfer {Add-BitsFile, Remove-BitsTransfer, Complete-BitsTransfe... Manifest CimCmdlets {Get-CimAssociatedInstance, Get-CimClass, Get-CimInstanc... Script ISE {New-IseSnippet, Import-IseSnippet, Get-IseSnippet} Manifest Microsoft.PowerShell.Diagnostics {Get-WinEvent, Get-Counter, Import-Counter, Export-Count... Manifest Microsoft.PowerShell.Host {Start-Transcript, Stop-Transcript} Manifest Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-ItemProperty, Join-Pa... Manifest Microsoft.PowerShell.Security {Get-Acl, Set-Acl, Get-PfxCertificate, Get-Credential...} Manifest Microsoft.PowerShell.Utility {Format-List, Format-Custom, Format-Table, Format-Wide...} Manifest Microsoft.WSMan.Management {Disable-WSManCredSSP, Enable-WSManCredSSP, Get-WSManCre... Script PSDiagnostics {Disable-PSTrace, Disable-PSWSManCombinedTrace, Disable-... Binary PSScheduledJob {New-JobTrigger, Add-JobTrigger, Remove-JobTrigger, Get-... Manifest TroubleshootingPack {Get-TroubleshootingPack, Invoke-TroubleshootingPack} Manifest WebAdministration {Start-WebCommitDelay, Stop-WebCommitDelay, Get-WebConfi... Directory: C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules ModuleType Name ExportedCommands ---------- ---- ---------------- Manifest SQLASCMDLETS {Add-RoleMember, Backup-ASDatabase, Invoke-ASCmd, Invoke... Manifest SQLPS {Backup-SqlDatabase, Add-SqlAvailabilityDatabase, Disabl... 

任何尝试在谷歌“安装servemanager模块”search返回数以千计的页面安装东西使用servermanager模块! : – \

我正在使用带有Service Pack 1的Windows Web Server 2008 R2和Powershell v4的最新副本。

解决了! 我必须使用32位版本的Powerhell,因为模块位于文件夹中:C:\ Windows \ System32 \ WindowsPowerShell \ v1.0 \ Modules \

看看C:\Windows\System32\WindowsPowerShell\v1.0\Modules ,你应该看到一个ServerManager文件夹。 如果你不这样做,那么模块不可用。

据我所知,这个模块只适用于2008 R2 标准版及以上版本。 我的2008(非R2)服务器缺乏它,但我的标准之一。 此外,请确保您使用的是64位PowerShell,而不是32位。