Contents
How to Rebuild
Rebuild the Performance counters with the following Powershell Script, you can copy and paste the below script to a Powershell ISE Window running as Administrator:
Push-Location $PWD
$FirstPath = 'C:\Windows\System32'
$SecondPath = 'C:\Windows\SysWOW64'
cd $FirstPath
Write-Output '---------------------------------------------------------'
Write-Output "Recreating Performance Counters in: $FirstPath"
Write-Output ' - Running: lodctr /R'
lodctr /R
cd $SecondPath
Write-Output "`nRecreating Performance Counters in: $SecondPath"
Write-Output ' - Running: lodctr /R'
lodctr /R
Write-Output '---------------------------------------------------------'
Write-Output 'Resyncing the Performance Counters with Windows Management Instrumentation (WMI)'
Write-Output ' - Running: C:\Windows\System32\wbem\WinMgmt.exe /RESYNCPERF'
C:\Windows\System32\wbem\WinMgmt.exe /RESYNCPERF
Write-Output '---------------------------------------------------------'
Write-Output 'Restarting Service: Performance Logs & Alerts (pla)'
$error.Clear()
try
{
Get-Service -Name "pla" | Restart-Service -ErrorAction Stop | Out-Null
}
catch
{
Write-Warning "A Failure has occurred: `n$error"
}
$error.Clear()
Write-Output 'Restarting Service: Windows Management Instrumentation (winmgmt)'
try
{
Get-Service -Name "winmgmt" | Restart-Service -Force -ErrorAction Stop | Out-Null
}
catch
{
Write-Warning "A Failure has occurred: `n$error"
}
Pop-Location
Share on:
About Blake Drumm