Created
March 15, 2023 20:00
-
-
Save Purp1eW0lf/ef9371d317e268d40a769d143128652a to your computer and use it in GitHub Desktop.
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
| #Run as Administrator, copy/paste the below | |
| # Mount HKU | |
| mount -PSProvider Registry -Name HKU -Root HKEY_USERS; | |
| # Loop through each HKU/user's HKCU, AND deploy OneNote defences | |
| (gci -path "HKU:\*\Software\Microsoft\Office\*\OneNote\Options\").PsPath | | |
| Foreach-Object {New-ItemProperty -Path $_ -Name "disableembeddedfiles" -Value 1 -type DWORD -verbose}; | |
| (gci -path "HKU:\*\Software\Microsoft\Office\*\OneNote\Options\").PsPath | | |
| Foreach-Object {New-Item -Path "$_\embeddedfileopenoptions" -verbose}; | |
| (gci -path "HKU:\*\Software\Microsoft\Office\*\OneNote\Options\").PsPath | | |
| Foreach-Object {New-ItemProperty -Path "$_\embeddedfileopenoptions" -Name "blockedextensions" -type string -value ".js;.exe;.bat;.vbs;.com;.scr;.cmd;.ps1" -verbose} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment