From 3c088f9c9d5851d07920836c3c8be8209e42bfe1 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Thu, 19 Aug 2021 10:10:44 -0500 Subject: [PATCH] Improved UndoAll this now removes all local security and group policy items on the PC to make sure it is at stock settings. --- .gitignore | 3 ++- win10debloat.ps1 | 24 ++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 118c7429..353f57f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ - +defltbase.jfm OOSU10.exe +defltbase.sdb \ No newline at end of file diff --git a/win10debloat.ps1 b/win10debloat.ps1 index e9c51eb5..98e0b53b 100644 --- a/win10debloat.ps1 +++ b/win10debloat.ps1 @@ -658,8 +658,6 @@ $essentialtweaks.Add_Click({ Write-Host "Stopping and disabling Superfetch service..." Stop-Service "SysMain" -WarningAction SilentlyContinue Set-Service "SysMain" -StartupType Disabled - Write-Host "Setting BIOS time to UTC..." - Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Type DWord -Value 1 Write-Host "Disabling Hibernation..." Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 0 If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings")) { @@ -717,6 +715,16 @@ $essentialtweaks.Add_Click({ Write-Host "Disable News and Interests" Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name "EnableFeeds" -Type DWord -Value 0 + # Remove "News and Interest" from taskbar + Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 2 + + # remove "Meet Now" button from taskbar + + If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) { + New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Force | Out-Null + } + +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "HideSCAMeetNow" -Type DWord -Value 1 Write-Host "Removing AutoLogger file and restricting directory..." $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" @@ -735,6 +743,11 @@ $essentialtweaks.Add_Click({ Write-Host "Essential Tweaks Completed" }) +$dualboottime.Add_Click({ +Write-Host "Setting BIOS time to UTC..." + Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Type DWord -Value 1 +}) + $essentialundo.Add_Click({ Write-Host "Creating Restore Point incase something bad happens" Enable-ComputerRestore -Drive "C:\" @@ -841,6 +854,13 @@ $essentialundo.Add_Click({ Write-Host "Hiding known file extensions" Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1 + Write-Host "Reset All Security and Local Group Policies to Stock Defaults" + cmd /c secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose + cmd /c RD /S /Q "%WinDir%\System32\GroupPolicyUsers" + cmd /c RD /S /Q "%WinDir%\System32\GroupPolicy" + cmd /c gpupdate /force + # Considered using Invoke-GPUpdate but requires module most people won't have installed + Write-Host "Essential Undo Completed" })