powershell sccm导入模块错误

从https://www.microsoft.com/en-us/download/details.aspx?id=46681下载了sccm powershell模块

通过.msi安装没有问题。 在导入时,像这样:

> Import-Module 'C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1' -Verbose > > Output (first few lines, many more snipped for brevity, then the > error): > > VERBOSE: Loading module from path 'C:\Program Files (x86)\Microsoft > Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1'. > VERBOSE: Loading 'Assembly' from path 'C:\Program Files > (x86)\Microsoft Configuration > Manager\AdminConsole\bin\AdminUI.PS.TypeAdapter.dll'. VERBOSE: Loading > 'Assembly' from path 'C:\Program Files (x86)\Microsoft Configuration > Manager\AdminConsole\bin\Microsoft.ConfigurationManagement.ManagementProvider.dll'. > VERBOSE: Loading 'Assembly' from path 'C:\Program Files > (x86)\Microsoft Configuration > Manager\AdminConsole\bin\AdminUI.WqlQueryEngine.dll'. VERBOSE: Loading > 'TypesToProcess' from path 'C:\Program Files (x86)\Microsoft > Configuration > Manager\AdminConsole\bin\Microsoft.ConfigurationManagement.PowerShell.Types.ps1xml'. 

 > VERBOSE: Importing cmdlet 'Clear-CMMigrationData'. VERBOSE: Loading > module from path 'C:\Program Files (x86)\Microsoft Configuration > Manager\AdminConsole\bin\AdminUI.PS.DatabaseReplication.dll'. > Import-Module : Could not load type > 'Microsoft.ConfigurationManagement.AdminConsole.Common.InvAvailabilityLevel' > from assembly 'AdminUI.Common, Version=5.0.0.0, Culture=neutral, > PublicKeyToken=31bf3856ad364e35'. At line:1 char:1 > + Import-Module $CMModulePath -Verbose > + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + CategoryInfo : NotSpecified: (:) [Import-Module], TypeLoadException > + FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand 

与错误相关的DLL相当新近:

 PS C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin> dir AdminUI.PS.DatabaseReplication* Directory: C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 4/6/2015 4:00 AM 40112 AdminUI.PS.DatabaseReplication.dll 

看起来像安装失败,因为我没有看到任何命令:

PS C:\ Program Files(x86)\ Microsoft Configuration Manager \ AdminConsole \ bin> Get-Command -Module ConfigurationManager | 测量对象

数量:0平均:总和:最大:最小:物业:

不知道如何从这里开始

看起来问题是SCCM我们运行的是“System Center 2012”而不是“System Center 2012 R2”

经过多次search,我看到这个“系统中心configurationpipe理器Cmdlet库”:

此版本支持以下版本的Configuration Manager:

 System Center 2012 R2 Configuration Manager 

原始的下载网站说:

支持的操作系统

Windows 7,Windows 8,Windows 8.1,Windows Server 2008,Windows Server 2008 R2,Windows Server 2012,Windows Server 2012 R2

当然,我很乐意尝试从Windows 7做到这一点。

叹。 看起来我们需要更新SCCM到R2,只是为了得到pwoershell来处理它。

发现SP1也有cmdlet,所以我必须让控制我们的SCCM服务器的人升级到至less…