When attempting in creating a MID Server we have noticed the following error it has generated:

Powershell initialization:

10/23/19 10:16:28 (271) WSMAN Setup SEVERE *** ERROR *** PowerShell will not be available
java.lang.Exception: Error encountered when invoking PowerShell, the result from running '"C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noninteractive -nologo -noprofile -command "$ver = if (Test-Path Variable:\PSVersionTable) { $PSVersionTable.PSVersion } else { (get-host).Version }; 'full_version:' + $ver.ToString() + ', major_version:' + $ver.Major"' is
at com.service_now.mid.probe.util.PowershellStatus.init(
at com.service_now.mid.probe.util.PowershellStatus.get(
at com.service_now.mid.probe.util.PowershellStatus.getExecutablePath(
at com.snc.sw.providers.wmi.WMIProviderImpl.setupWsmanDefinition(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$


This could be a couple of scenario as to why we see this:

  1. The issue looks to be with querying Powershell to determine the version, which I see it is looking for version 1 and we currently do not support this, only version 2.0 and greater.
    • C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
  2. In the following docs for PowerShell version requirements: PowerShell For Discovery
  3. In the following path it is looking in C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe <-- is this installed?
    • Perhaps, the issue maybe it is not installed.
  4. There may be an AntiVirus Daemon installed which is preventing the MID Server service to running any Powershell initialization.
    • A solution to this is to consult with your security team that manages this. So we can have the MID Server service invoke PowerShell on the MID Server host.
    • This is related to this KB - KB0750324 - "MID Server PowerShell Initialization Issue with error message [Error encountered when invoking PowerShell, the result from running '"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noninteractive -nologo -noprofile ...]"
  5. Also, the PowerShell execution policy on the MID Server is set to "AllSigned" or "remoteSigned" which would force the policy to throw an error similar to what we are seeing. A simple fix is to set the PowerShell policy to "Unrestricted". However, I highly doubt this would be the case.
  6. Lastly, there may be a possibility of several other powershell.exe entries that exist in the server. You can use the dir functionality to search the directory and all of its children directories while filtering on a particular file type. Use the following command:
    • dir /s /b *.exe | findstr /v .exe

Article Information

Last Updated:2019-11-04 08:07:36