API Reference
Command
Set-CxDefenderRealtime
Enables or disables Microsoft Defender real-time protection on a computer.
Examples
Example 1: Disables local real-time protection during a controlled maintenance window.
PS>
Set-CxDefenderRealtime -Enabled $false
Example 2: Re-enables real-time protection on a remote server after maintenance completes.
PS>
Set-CxDefenderRealtime -ComputerName APP-SEC-01 -Enabled $true
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Set-CxDefenderRealtime -Enabled <bool> [-ComputerName <string>] [<CommonParameters>]#Parameters
- Enabled bool
- Set to $true to enable real-time protection or $false to disable it.
- ComputerName string
- Target computer name. Use . for the local machine or provide a DNS/NetBIOS name. When omitted, the local computer is queried.