ServerManager报错,自动退出,删除注册表:
HKLM\SOFTWARE\Microsoft\ServerManager\ServicingStorage\ServerComponentCache
重启服务器后生效
==============================
如果以上不行就执行下面的
# 强制结束进程,保存为PS1执行
Stop-Process -Name ServerManager -Force -ErrorAction SilentlyContinue
# 删除缓存目录所有缓存文件
$cachePath = "$env:LocalAppData\Microsoft\ServerManager"
if(Test-Path $cachePath){
Remove-Item "$cachePath\Cache\*" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$cachePath\*cache.xml" -Force -ErrorAction SilentlyContinue
}
Get-WindowsFeature
看是否能列出功能列表
重置 WMI/CIM 仓库:
net stop winmgmt
ren C:\Windows\System32\wbem\repository repository_bak
net start winmgmt
Get-WindowsFeature | Select-Object -First 20
看是否报错
winmgmt /salvagerepository
net stop winmgmt /y
sc config winmgmt start= disabled
cd C:\Windows\System32\wbem
:: 备份旧仓库
ren repository repository.bak
:: 重新注册wbem下所有dll
for /f %s in ('dir /b *.dll') do regsvr32 /s %s
:: 重新编译MOF
mofcomp *.mof
sc config winmgmt start= auto
net start winmgmt
HKLM\SOFTWARE\Microsoft\ServerManager\ServicingStorage\ServerComponentCache
重启服务器后生效
==============================
如果以上不行就执行下面的
# 强制结束进程,保存为PS1执行
Stop-Process -Name ServerManager -Force -ErrorAction SilentlyContinue
# 删除缓存目录所有缓存文件
$cachePath = "$env:LocalAppData\Microsoft\ServerManager"
if(Test-Path $cachePath){
Remove-Item "$cachePath\Cache\*" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$cachePath\*cache.xml" -Force -ErrorAction SilentlyContinue
}
Get-WindowsFeature
看是否能列出功能列表
重置 WMI/CIM 仓库:
net stop winmgmt
ren C:\Windows\System32\wbem\repository repository_bak
net start winmgmt
Get-WindowsFeature | Select-Object -First 20
看是否报错
winmgmt /salvagerepository
net stop winmgmt /y
sc config winmgmt start= disabled
cd C:\Windows\System32\wbem
:: 备份旧仓库
ren repository repository.bak
:: 重新注册wbem下所有dll
for /f %s in ('dir /b *.dll') do regsvr32 /s %s
:: 重新编译MOF
mofcomp *.mof
sc config winmgmt start= auto
net start winmgmt
文章来源:
网络小编D
版权声明:
本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,请联系本站立刻删除。
