Powershell Set-MpPreference -DisableRealtimeMonitoring $ true无法正常工作 [英] Powershell Set-MpPreference -DisableRealtimeMonitoring $true not working correctly

查看:304
本文介绍了Powershell Set-MpPreference -DisableRealtimeMonitoring $ true无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须警告您,我不太会使用Powershell.我试图通过Powershell关闭Windows Defender实时保护,我发现了命令 Set-MpPreference -DisableRealtimeMonitoring $ true ,并以管理员权限尝试了此操作,只是为了获得此

I must warn you I don't use powershell much. I am trying to turn off windows defender real time protection via powershell I found the command Set-MpPreference -DisableRealtimeMonitoring $true and tried it in admin privileges only to get this

Set-MpPreference:操作失败,出现以下错误:0x800106ba.操作:Set-MpPreference.目标:禁用实时监控.在第1行:char:1
+ Set-MpPreference -DisableRealtimeMonitoring $ true
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo:未指定:(MSFT_MpPreference:root \ Microsoft ... FT_MpPreference)
[Set-MpPreference],CimException
+ FullyQualifiedErrorId:HRESULT 0x800106ba,Set-MpPreference

Set-MpPreference : Operation failed with the following error: 0x800106ba. Operation: Set-MpPreference. Target: DisableRealtimeMonitoring. At line:1 char:1
+ Set-MpPreference -DisableRealtimeMonitoring $true
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (MSFT_MpPreference:root\Microsoft...FT_MpPreference)
[Set-MpPreference], CimException
+ FullyQualifiedErrorId : HRESULT 0x800106ba,Set-MpPreference

有什么想法吗?

推荐答案

问题是计算机上的 Windows Defender防病毒服务似乎被永久禁用 .

The problem is that the Windows Defender antivirus services seem to be persistently disabled on your machine.

不幸的是, Set-MpPreference cmdlet以这种晦涩的方式报告了这一情况.

It's unfortunate that the Set-MpPreference cmdlet reports this in such an obscure fashion.

要解决此问题,请 重新启用 Windows Defender防病毒服务:

To fix this problem, re-enable the Windows Defender antivirus services:

执行此操作最简单的方法如下,但是请注意,这涉及重新启动:

The easiest way to do this is the following, but note that it involves a reboot:

Set-ItemProperty 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender' DisableAntiSpyware 0
Restart-Computer

  • 您可以改为使用这篇Windowscentral.com文章,或使用 regedit.exe 的GUI或我们的 reg.exe CLI实用程序.

    • You may instead use the Local Group Policy Editor-based method described in this windowscentral.com article or use regedit.exe's GUI or us the reg.exe CLI utility.

      • 请注意,链接的说明略有过时-代替节点 Windows Defender ,设置关闭Windows Defender ,目标节点 Windows Defender Antivirus ,设置关闭Windows Defender防病毒软件).

      • Note that the linked instructions are slightly outdated - instead of node Windows Defender, setting Turn off Windows Defender, target node Windows Defender Antivirus, setting Turn off Windows Defender Antivirus).

      使用本地组策略编辑器( gpedit.msc )来关闭防病毒服务 会立即生效,在服务真正重启之前,它们需要 分钟(em),从正面来看,不需要重新启动,这与链接的说明不同.

      While using the Local Group Policy Editor (gpedit.msc) to turn the antivirus services off takes effect immediately, turning them back on can take minutes before the services are actually restarted (on the plus side, no reboot is required, unlike what the linked instructions say).

      请注意,如果您通过注册表重新启用,例如通过上述PowerShell命令,而禁用最初是通过[local]组策略执行的,则该策略将继续反映该禁用(但是,它是注册表设置).

      Note that if you reenable via the registry, such as via the above PowerShell command whereas disabling was originally performed via [local] group policy, that policy will continue to reflect the disabling (however, it is the registry setting that matters).

      这篇关于Powershell Set-MpPreference -DisableRealtimeMonitoring $ true无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆