Skip to content

Commit

Permalink
Create Enable_ASR.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
harishsg993010 authored Jan 8, 2023
1 parent 307c676 commit bc67984
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Enable_ASR.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Get the list of ASR rules
$asrRules = Get-MpPreference -AttackSurfaceReductionRules

# Loop through each ASR rule and enable it
foreach ($rule in $asrRules) {
# Check if the rule is disabled
if ($rule.Setting -eq 0) {
# Enable the rule
Set-MpPreference -AttackSurfaceReductionRules_Ids $rule.Id -AttackSurfaceReductionRules_Actions Enable
}
}

# Check the status of the ASR rules
Get-MpPreference -AttackSurfaceReductionRules

0 comments on commit bc67984

Please sign in to comment.