【问题标题】:Powershell Set-MpPreference -DisableRealtimeMonitoring $true not workingPowershell Set-MpPreference -DisableRealtimeMonitoring $true 不起作用
【发布时间】:2020-02-03 07:55:30
【问题描述】:

要禁用 Windows Defender,我在 Windows 10 中使用 PowerShell(以管理员身份)运行以下命令: Set-MpPreference -DisableRealtimeMonitoring $true

但实时保护并没有被禁用。

谁能知道如何以编程方式禁用实时保护?

【问题讨论】:

  • 您是否以管理员身份运行命令?这对我来说很好(Windows 10)。我确实收到一个弹出窗口,建议我重新打开它并查看病毒和威胁防护,当我使用 $true / $false 设置运行命令时,我看到它打开和关闭。
  • 是的,我正在以管理员身份运行命令

标签: powershell security cmd windows-defender


【解决方案1】:

篡改保护(启用时)可防止“Set-MpPreference -DisableRealtimeMonitoring $true”执行任何操作。

【讨论】:

【解决方案2】:

虽然在我的 Windows 10 机器上,Set-MpPreference -DisableRealtimeMonitoring $true 可以正常工作,但您可以尝试直接在注册表中对其进行操作:

# Windows Defender DisableRealtimeMonitoring
$regpath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender"
if (!(Test-Path $regpath -PathType Container)) {
    $null = New-Item -Path $regpath -ItemType Container -Force
}
Set-ItemProperty -Path $regpath -Name "DisableRealtimeMonitoring" -Value 1 -Type DWord -Force
# restart the service
Restart-Service  -Name WinDefend -Confirm:$false -Force

要重新打开它,请删除“DisableRealtimeMonitoring”条目或将其值设置为 DWORD 0

【讨论】:

  • 我收到错误Restart-Service : Service 'Windows Defender Antivirus Service (WinDefend)' cannot be stopped due to the following error: Cannot open WinDefend service on computer '.'. At line:1 char:1 + Restart-Service -Name WinDefend -Confirm:$false -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (System.ServiceProcess.ServiceController:ServiceController) [Restart-Service ], ServiceCommandException + FullyQualifiedErrorId : CouldNotStopService,Microsoft.PowerShell.Commands.RestartServiceCommand
  • 先尝试禁用篡改保护
【解决方案3】:

我用过按键

ctrl + esc 键入字符串“病毒保护” 进入 标签 x 4 进入 blahblah = 其余按键可关闭防御者和防火墙以及其他所有内容,例如卸载 avast 和 avg lol

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多