Powershell:添加管理单元(安装util managementCmdlets.dll)

时间:2013-11-27 09:54:25

标签: powershell dll installutil

Howsit!

我需要一个解决方案,我需要添加一个管理单元 - 但不能。

我正在尝试在我公司的共享点网站上运行流程

因此真正的错误:Get-SPSite: 'Get SPSite' is not recognized as the name of a cmdlet, function, script file,..

需要添加管理单元来解决此问题(从示例3系统地开始工作:来自网站http://technet.microsoft.com/en-us/library/hh849705(v=wps.620).aspx

我被困在第四个命令(不确定选择或下载哪个installutil?): It does not exist/ cannot find the installutil: ManagementCmdlets.dll   - 有谁知道在哪里下载这个?

我尝试了一个名为 Microsoft.PowerShell.Commands.Management.dll 的文件但是

the installation failed, and the rollback has been performed

Powershell代码如下(如果这可能有帮助):

PS C:\Users\Gisintern1.PPF> get-pssnapin -registered
PS C:\Users\Gisintern1.PPF> set-alias installutil $env:windir\Microsoft.NET\Framework\v2.0.50727\installutil.exe
PS C:\Users\Gisintern1.PPF> installutil C:\Dev\Management\ManagementCmdlets.dll
**Microsoft (R) .NET Framework Installation utility Version 2.0.50727.5420
Copyright (c) Microsoft Corporation.  All rights reserved.
Exception occurred while initializing the installation:
System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Dev\Management\ManagementCmdlets.dll' or one of its dependencies. 
The system cannot find the file specified..

1 个答案:

答案 0 :(得分:0)

根据该网站,似乎ManagementCmdlets.dll是一个虚构的管理单元,仅用于示例以显示该过程的工作原理。

我自己没有尝试通过PowerShell管理SharePoint,但我做了一些挖掘。从它的外观来看,Get-SPSite管理单元与SharePoint 2010一起安装,我也会假设它的其他一些版本。在安装SharePoint的同一台服务器上,我会尝试运行:

Add-PsSnapin Microsoft.SharePoint.PowerShell
Get-SPSite

或者(并且每https://blogs.technet.com/b/heyscriptingguy/archive/2010/09/20/get-started-managing-sharepoint-2010-with-powershell-cmdlets.aspx)可能会启动一个“SharePoint Management Shell”,它似乎会将正确的管理单元自动加载到正常的PowerShell环境中。

希望这两个想法中的一个可以帮助你。