# 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 Monitoring Agent (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。