-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95d4c11
commit 4305589
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Define the list of executables to block | ||
$executables = @("csc.exe", "DataSvcUtil.exe", "Ieexec.exe", "Ilasm.exe", "InstallUtil.exe", "Jsc.exe", "Microsoft.Workflow.Compiler.exe", "MSBuild.exe","dotnet.exe") | ||
|
||
# Set the path to the .NET Framework folder | ||
$dotnetPath = "C:\Windows\Microsoft.NET\Framework\" | ||
|
||
# Loop through the list of executables | ||
foreach ($executable in $executables) { | ||
|
||
# Construct the path to the executable | ||
$path = Join-Path -Path $dotnetPath -ChildPath $executable | ||
|
||
# Check if the file exists | ||
if (Test-Path -Path $path) { | ||
|
||
#Block the executable by adding a new rule to the Group Policy Editor | ||
New-GPRegistryValue -Name "Restrict_Execution_Of_Certain_Windows_Application" -Key "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -ValueName $executable -Type String -Value "0" | ||
} | ||
} |