Another small wrapup. On my Exchange server, I had this annoying error every 15 minutes:
Log Name: Application Source: MSExchange Common Event ID: 106 Level: Error Computer: exchange2013.itexperience.net Description: Performance counter updating error. Counter name is Time in Resource per second, category name is MSExchange Activity Context Resources. Optional code: 2. Exception: The exception thrown is : System.InvalidOperationException: Instance 'ad-powershell-defaultdomain' already exists with a lifetime of Process. It cannot be recreated or reused until it has been removed or until the process using it has exited.
Although this notification is pretty harmless, it’s still amazingly annoying. Especially since it is categorized as Error.
To solve this error, we need to modify an XML file, and then rebuild the performance counter. Follow these steps:
- Open Notepad as Administrator. You need to have elevated rights
- Click File -> Open -> Navigate to C:\Program Files\Microsoft\Exchange Server\V15\Setup\Perf\
if you installed Exchange in a custom location, navigate to that directory + V15\Setup\Perf\ - Open InfoWorkerMultiMailboxSearchPerformanceCounters.xml
- The XML file contains several whitespaces that cause the error. Therefor, press Ctrl+H (Search and Replace) and search for “> ” (without quotes). Replace every “> ” for “>”
- Save the file
- Now, open Exchange Management Shell als Administrator.
- Run the following command: New-PerfCounters -DefinitionFileName “C:\Program Files\Microsoft\Exchange Server\V15\Setup\Perf\InfoWorkerMultiMailboxSearchPerformanceCounters.xml”
And again: if you installed Exchange in a custom location, replace C:\Program Files\… with that path…
That should be all.
Still got errors? It may be necessary to rebild all performance counters. In the Exchange Management Shell, run the following lines:
add-pssnapin Microsoft.Exchange.Management.PowerShell.Setup $files=get-childitem “C:\Program Files\Microsoft\Exchange Server\V15\Setup\Perf\" *.xml |where-object {!($_.psiscontainer)} foreach ($file in $files) {remove-perfcounters -definitionfilename $file.fullname} foreach ($file in $files) {new-perfcounters -definitionfilename $file.fullname}
More info also here: https://support.microsoft.com/en-us/help/2870416/-performance-counter-updating-error-after-you-install-an-exchange-server-2013-cumulative-update