www.pudn.com > reload_perf_counters.zip > reload_perf_counters.ps1, change:2017-05-12,size:595b


param([String]$hostname = "server.dns.name") 
 
Invoke-Command -ComputerName $hostname -ScriptBlock { 
	Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Setup 
	$perfcounters = Get-ChildItem "$env:ExchangeInstallPath\Setup\Perf\" *.xml | Where-Object {!($_.psiscontainer)} 
	$perfcount = $perfcounters.Count 
 
	$i = 0 
	foreach ($perfcounter in $perfcounters) { 
	$i = $i + (100 / $perfcount) 
	New-PerfCounters -DefinitionFileName $perfcounter.FullName -ErrorAction SilentlyContinue 
	Write-Progress -Activity "Reloading $perfcount Exchange Performance Counters" -PercentComplete ($i)} 
}