【问题标题】:Powershell: Add Snap-in (install util managementCmdlets.dll)Powershell:添加管理单元(安装 util managementCmdlets.dll)
【发布时间】:2013-11-27 09:54:25
【问题描述】:

你好!

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

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

因此真正的错误: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..

【问题讨论】:

    标签: powershell dll installutil


    【解决方案1】:

    根据该站点,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 命令行管理程序”,它似乎会自动将正确的管理单元加载到其他正常的 PowerShell 环境中。

    希望这两个想法中的一个对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-16
      • 1970-01-01
      • 1970-01-01
      • 2014-01-23
      相关资源
      最近更新 更多