1

Have downloaded the sccm powershell module from https://www.microsoft.com/en-us/download/details.aspx?id=46681

Installed via the .msi no issues. On import, like so:

>     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

The DLL associated with the error is quite recent:

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 

Looks like the install failed since I don't see any commands:

PS C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin> Get-Command -Module ConfigurationManager | measure-object

Count : 0 Average : Sum : Maximum : Minimum : Property :

Not sure how to proceed from here

sdjuan
  • 221
  • 2
  • 16

1 Answers1

1

Looks like the issue is that the SCCM we are running "System Center 2012" rather than "System Center 2012 R2"

After much searching I see this for "System Center Configuration Manager Cmdlet Library":

The following versions of Configuration Manager are supported in this release:

System Center 2012 R2 Configuration Manager

Whereas the original download site says:

Supported Operating System

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

And of course I was blissfully trying to do this from windows 7.

Sigh. Looks like we need to update SCCM to R2 just to get pwoershell to work with it.

[edit] found that SP1 also has cmdlets so I'll have to get the folks who control our SCCM server to upgrade to at least that...

sdjuan
  • 221
  • 2
  • 16
  • /blush/ TL;DR To use the System Center Configuration Manager Cmdlet Library, you must install the following: Windows PowerShell 3.0 System Center 2012 R2 Configuration Manager console – sdjuan May 01 '15 at 16:58