Table of Contents


Problem

You might encounter EventID 106 errors on Exchange 2013/2016 servers.

There are some articles available on how to fix this issue on servers with a full installation of Exchange Server 2013/2016. But you might encounter this error on servers having the Exchange 2013/2016 Management Tools installed only as well. In this case, the solutions described will not work as expected.

Running the New-PerfCounters cmdlet requires the Microsoft.Exchange.Management.PowerShell.Setup PowerShell snap-in. This PowerShell snap-in cannot be loaded on servers having the Exchange Management Tools installed.

Add-PsSnapin : The Windows PowerShell snap-in 'Microsoft.Exchange.Management.PowerShell.Setup' is not installed on
this computer.
At line:1 char:1
+ Add-PsSnapin Microsoft.Exchange.Management.PowerShell.Setup
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Excha...owerShell.Setup:String) [Add-PSSnapin], PSArgumentEx
   ception
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

 

Solution

The required code library (Microsoft.Exchange.PowerShell.Configuration.dll) is available on servers having the Exchange Management Tools installed. But the library is not added to the registry by default.

 

Registry of a server running Exchange Management Tools only:

 

Registry of a full installed Exchange Server:

 

Just export the registry key Microsoft.Exchange.Management.PowerShell.Setup from an Exchange Server, fix the Exchange file paths (if required), and import the registry file on the server having the Exchange Management Tools installed.

Example registry file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.Exchange.Management.PowerShell.Setup]
"CustomPSSnapInType"="Microsoft.Exchange.Management.PowerShell.SetupPSSnapIn"
"ApplicationBase"="D:\\Program Files\\Microsoft\\Exchange Server\\V15\\bin"
"AssemblyName"="Microsoft.Exchange.PowerShell.Configuration, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
"Description"="Setup Tasks for the Exchange Server"
"ModuleName"="D:\\Program Files\\Microsoft\\Exchange Server\\V15\\bin\\Microsoft.Exchange.PowerShell.configuration.dll"
"PowerShellVersion"="1.0"
"Vendor"="Microsoft"
"Version"="15.0.0.0"

After adding the registry key, you can successfully fix the performance counter issue.

Add-PsSnapin Microsoft.Exchange.Management.PowerShell.Setup 
New-PerfCounters -DefinitionFileName "$exinstall\setup\perf\WorkerTaskFrameworkPerfCounters.xml”

 

Links