Last active
September 18, 2023 22:23
-
-
Save byinarie/8ac87d955a9d179b30f0c1b3d522bdc8 to your computer and use it in GitHub Desktop.
getdef.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$REGISTRY_KEYS = @( | |
'SOFTWARE\Policies\Microsoft\Windows Defender', | |
'SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection', | |
'SOFTWARE\Policies\Microsoft\Windows Defender\Reporting', | |
'SOFTWARE\Policies\Microsoft\Windows Defender\SpyNet' | |
) | |
$VALUES = @( | |
'DisableAntiSpyware', | |
'DisableAntiVirus', | |
'DisableIntrusionPreventionSystem', | |
'DisableBehaviorMonitoring', | |
'DisableIOAVProtection', | |
'DisableRealtimeMonitoring', | |
'DisableOnAccessProtection', | |
'DisableScanOnRealtimeEnable', | |
'DisableEnhancedNotifications', | |
'DisableBlockAtFirstSeen' | |
) | |
foreach ($key in $REGISTRY_KEYS) { | |
Write-Host "Registry Key: $key" | |
foreach ($valueName in $VALUES) { | |
try { | |
$value = Get-ItemProperty -Path "HKLM:\$key" -Name $valueName -ErrorAction Stop | |
Write-Host "$valueName = $($value.$valueName)" | |
} catch { | |
Write-Host "Error retrieving $valueName from $key: $_" | |
} | |
} | |
Write-Host "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment