# Option 1: This will read the console install directory from registry and then execute. Useful if installed in a non-default directory
Start-Process ((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\System Center Operations Manager\12\Setup\Console").InstallDirectory + "Microsoft.EnterpriseManagement.Monitoring.Console.exe") -ArgumentList "/clearCache"
# Option 2: This will start the process in the default ProgramFiles directory
Start-Process "$Env:ProgramFiles\Microsoft System Center\Operations Manager\Console\Microsoft.EnterpriseManagement.Monitoring.Console.exe" -ArgumentList "/clearCache"
視組織原則而定,這可能需要從系統管理員命令提示字元執行。
"%ProgramFiles%\Microsoft System Center\Operations Manager\Console\Microsoft.EnterpriseManagement.Monitoring.Console.exe" /clearcache
# This will read the install directory from registry and perform the same steps outlined
Stop-Service HealthService -Force -Verbose;
Remove-Item -Path "$((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\System Center Operations Manager\12\Setup\Server").InstallDirectory + 'Health Service State')" -Recurse -Force;
Start-Service HealthService -Verbose
命令提示字元 (以批次處理檔的形式):
:: Clear Health Service State (Cache)
ECHO OFF
net stop HealthService
FOR /F "usebackq tokens=2,* skip=2" %%L IN (`reg query "HKLM\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup" /v InstallDirectory`) DO SET installpath=%%M
echo %installpath%
@RMDIR "%installpath%Health Service State" /S /Q
net start HealthService
瀏覽至伺服器。
停止Microsoft監視代理程式 (HealthService) 服務。
刪除快取資料夾: %ProgramFiles%\Microsoft System Center\Operations Manager\Server\Health Service State。
重新啟動Microsoft監視代理程式 (HealthService) 服務。
閘道伺服器
疑難解答的最後一個步驟是清除快取。 有時候,閘道可能不會與管理伺服器通訊,且在 System Center Operations Manager 控制台中呈現灰色。 在這種情況下,我們需要清除閘道的快取。 當閘道有過期或無法使用的管理元件或無法插入資料庫的數據時,我們也需要這麼做。
# This will read the install directory from registry and perform the same steps outlined
Stop-Service HealthService -Force -Verbose;
Remove-Item -Path "$((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\System Center Operations Manager\12\Setup\Gateway").InstallDirectory + 'Health Service State')" -Recurse -Force;
Start-Service HealthService -Verbose
命令提示字元 (以批次處理檔的形式):
:: Clear Health Service State (Cache)
ECHO OFF
net stop HealthService
FOR /F "usebackq tokens=2,* skip=2" %%L IN (`reg query "HKLM\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup" /v InstallDirectory`) DO SET installpath=%%M
echo %installpath%
@RMDIR "%installpath%Health Service State" /S /Q
net start HealthService
瀏覽至伺服器。
停止Microsoft監視代理程式 (HealthService) 服務。
刪除快取資料夾: %ProgramFiles%\Microsoft System Center\Operations Manager\Gateway\Health Service State。
# This will read the install directory from registry and perform the same steps outlined
Stop-Service HealthService -Force -Verbose;
Remove-Item -Path "$((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\System Center Operations Manager\12\Setup\Agent").InstallDirectory + 'Health Service State')" -Recurse -Force;
Start-Service HealthService -Verbose
命令提示字元 (以批次處理檔的形式):
:: Clear Health Service State (Cache)
ECHO OFF
net stop HealthService
FOR /F "usebackq tokens=2,* skip=2" %%L IN (`reg query "HKLM\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup" /v InstallDirectory`) DO SET installpath=%%M
echo %installpath%
@RMDIR "%installpath%Health Service State" /S /Q
net start HealthService
瀏覽至客戶端電腦。
停止Microsoft監視代理程式 (HealthService) 服務。
刪除快取資料夾: %ProgramFiles%\Microsoft Monitoring Agent\Agent\Health Service State。