Skip to content

Instantly share code, notes, and snippets.

@Purp1eW0lf
Created March 15, 2023 20:02
Show Gist options
  • Save Purp1eW0lf/28776631fd731fa2418e80d96ab7f52d to your computer and use it in GitHub Desktop.
Save Purp1eW0lf/28776631fd731fa2418e80d96ab7f52d to your computer and use it in GitHub Desktop.
#run as Administrator, copy/paste the below
# Mount HKU
mount -PSProvider Registry -Name HKU -Root HKEY_USERS;
# Loop through each HKU/user's HKCU, loop though each Office version and application, and implement defences
(gci -path "HKU:\*\Software\Microsoft\Office\*\*\Security\").PsPath |
Foreach-Object {Set-ItemProperty -path $_ -name "blockcontentexecutionfrominternet" -value 1 -Type DWord -verbose}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment