Search code examples
shellpowershellconsolescom

SCOM 2016 PowerShell


I'm trying to package SCOM Console 2016 using Thinapp 5.2. The customer wants to use the PowerShell part of SCOM as well. But whenever i start SCOM Shell, it gives me a bunch of errors telling me that it can't find certain .dll files and more.

I have already tried installing it on a VM before but it gives me the same error messages, so Thinapp is not causing the errors.

Does anyone know where i should look?

Import-Module : Cannot load Windows PowerShell snap-in C:\Program Files (x86)\System Center Operations Manager 2016\Powershell\OperationsManager\OM10.CoreCommands\Microsoft.EnterpriseManagement.Core.Cmdlets.dll because of the following error: Unable to load one or more of the requested types.  Retrieve the LoaderExceptions property for more information.

Loader Exceptions:
Could not load file or assembly Microsoft.EnterpriseManagement.Core, Version=7.0.5000.
, Culture=neutral, PublicKeyToken=31bf3856ad364e35 or one of its dependencies.
The system cannot find the file specified.

At C:\Program Files (x86)\System Center Operations Manager 2016\Powershell\OperationsManager\OperationsManager.psm1:1261 char:14
    + Import-Module <<<<  $psScriptRoot\OM10.CoreCommands\OM10.CoreCommands.psd1
    + CategoryInfo          : ResourceUnavailable: (:) [Import-Module], PSSnapInException
    + FullyQualifiedErrorId : PSSnapInLoadFailure,Microsoft.PowerShell.Commands.ImportModuleCommand
	
Import-Module : Could not load file or assembly file:///C:\Program Files (x86)\Systemcenter Operations Manager 2016\Powershell\OperationsManager\OM10.Commands\Microsoft.SystemCenter.OperationsManagerV10.Commands.dll or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded
At C:\Program Files (x86)\System Center Operations Manager 2016\Powershell\OperationsManager\OperationsManager.psm1:1262 char:14
    + Import-Module <<<<  $psScriptRoot\OM10.Commands\OM10.Commands.psd1
    + CategoryInfo          : NotSpecified: (:) [Import-Module], BadImageFormatException
    + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.ImportModuleCommand

Add-Type : Could not load file or assembly file:///C:\Program Files (x86)\System Center Operations Manager 2016\Console\Microsoft.Mom.Common.dll or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded
At C:\Program Files (x86)\System Center Operations Manager 2016\Powershell\OperationsManager\OperationsManager.psm1:1311 char:15
    + Add-Type <<<<  -Path $consoleMomCommon
    + CategoryInfo          : NotSpecified: (:) [Add-Type], BadImageFormatException
    + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.AddTypeCommand


Solution

  • Problem solved, it turned out we were using an old version of Windows Management Framework. After updating to version 5.1 all the errors were gone. I installed this update: KB3191566