While using Windows Admin Center(WAC), I encountered CimCmdLets Connection error. This article aims to provide a solution for WAC CimCmdLets Connection error.
Windows Admin Center is a locally deployed, browser-based app for managing Windows servers, clusters, hyper-converged infrastructure. Windows Admin Center is a free product that is ready to use in production. You can download the latest version of Windows Admin Center from the Microsoft Evaluation Center.
Usually with Windows Admin Center, you connect to Windows Servers and manage them. However, all of a sudden, I noticed an error popping up while connecting to one of my servers. The CimCmdLets Connection error appeared while connecting to more than one server in Windows Admin Center console.
Fix Windows Admin Center CimCmdLets Connection Error
When trying to connecting to server from Windows Admin Center, the following error was seen.
Connection Error – Remote Exception: The specified module ‘CimCmdlets’ was not loaded because no valid module file was found in any module directory.
The CimCmdLets Connection error appears when it cannot find the required module file in the module directory. It could be the fact that the file is on your system, but the path where it tries to look for it is not defined properly.
Adding the module path to the environmental variable using a PowerShell script will fix the CimCmdlets error.
Open up an elevated PowerShell and look for the contents of the environment variable by just typing this command:
To fix the Windows Admin Center CimCmdlets connection error, perform the following steps:
First, launch the Windows PowerShell ISE as administrator. Now copy the below PowerShell script and run it in Windows PowerShell ISE.
You may also save this script as file.ps1 and run it from a PowerShell window. This script is available on Microsoft Site for download. The following PowerShell script adds the
C:\Windows\System32\WindowsPowerShell\v1.0\Modules path to the value of the PSModulePath environment variable without expanding the un-expanded strings.
$key = (Get-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager').OpenSubKey('Environment', $true) $path = $key.GetValue('PSModulePath','','DoNotExpandEnvironmentNames') $path += ';C:\Windows\System32\WindowsPowerShell\v1.0\Modules' $key.SetValue('PSModulePath',$path,[Microsoft.Win32.RegistryValueKind]::ExpandString)
Once the script is executed successfully, close the PowerShell ISE. Now launch the Windows Admin Center and the WAC CimCmdLets Connection error should be fixed now.