# encoding: ascii
# api: powershell
# title: Exchange PerfCounters
# description: a quick script to re-create Exchange 2013 performance counters, more information check: http://www.ntsystems.it/post/Exchange-2013-clean-install-but-many-MSExchange-Common-106-errors.aspx
# version: 0.1
# author: thomas torggler
# license: CC0
# x-poshcode-id: 4196
# x-archived: 2013-11-27T06:34:22
# x-published: 2013-06-09T12:42:00
#
#
# Add the Exchange Setup Snapin
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Setup
# Get the performace counter definitions from within the Exchange setup directory and recreate the counters
Get-ChildItem "$exInstall\Setup\Perf" | Where-Object {$_.Name -match ".xml"} | Foreach {New-PerfCounters -DefinitionFileName $_.FullName}
