From effa55eb2be30fa6c7a2efa45b526dac58e2ca1e Mon Sep 17 00:00:00 2001 From: Paulo Henrique Palmeira Franco Date: Thu, 10 Nov 2016 08:38:35 -0200 Subject: [PATCH 01/35] Update remove-default-apps.ps1 DB6EA5DB.CyberLinkMediaSuiteEssentials came with Dell Machines Microsoft.OneConnect came with some Microsoft Updates --- scripts/remove-default-apps.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index 803644e..6fdc1be 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -38,12 +38,14 @@ $apps = @( "Microsoft.ZuneVideo" "microsoft.windowscommunicationsapps" "Microsoft.MinecraftUWP" + # Threshold 2 apps "Microsoft.CommsPhone" "Microsoft.ConnectivityStore" "Microsoft.Messaging" "Microsoft.Office.Sway" + "Microsoft.OneConnect" #Redstone apps @@ -69,6 +71,7 @@ $apps = @( "TuneIn.TuneInRadio" "GAMELOFTSA.Asphalt8Airborne" #"TheNewYorkTimes.NYTCrossword" + "DB6EA5DB.CyberLinkMediaSuiteEssentials" # apps which cannot be removed using Remove-AppxPackage #"Microsoft.BioEnrollment" From b1d0dcbf03fab6a37dcecb187ba344324d7f0bde Mon Sep 17 00:00:00 2001 From: Paulo Henrique Palmeira Franco Date: Thu, 10 Nov 2016 08:46:50 -0200 Subject: [PATCH 02/35] Update remove-default-apps.ps1 Microsoft.WindowsFeedbackHub came with some Microsoft Update --- scripts/remove-default-apps.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index 803644e..4718d06 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -44,6 +44,7 @@ $apps = @( "Microsoft.ConnectivityStore" "Microsoft.Messaging" "Microsoft.Office.Sway" + "Microsoft.WindowsFeedbackHub" #Redstone apps From b177d0b64230cfcf757aa1836d0cd12459798f7c Mon Sep 17 00:00:00 2001 From: DSacks91 Date: Wed, 30 Nov 2016 22:27:43 -0500 Subject: [PATCH 03/35] Fixed Typo --- scripts/remove-default-apps.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index 391d602..ca86b2e 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -4,7 +4,7 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 -echo "Elevating priviledges for this process" +echo "Elevating privileges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) echo "Uninstalling default apps" From 51e0b7560770e2457cba32fc90b3b79d791d5856 Mon Sep 17 00:00:00 2001 From: kyedavey Date: Sun, 18 Dec 2016 13:43:49 +1100 Subject: [PATCH 04/35] Update remove-default-apps.ps1 Added Facebook and RoyalRevolt2 to non-Microsoft Apps --- scripts/remove-default-apps.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index ca86b2e..dd38986 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -72,6 +72,8 @@ $apps = @( "GAMELOFTSA.Asphalt8Airborne" #"TheNewYorkTimes.NYTCrossword" "DB6EA5DB.CyberLinkMediaSuiteEssentials" + "Facebook.Facebook" + "flaregamesGmbH.RoyalRevolt2" # apps which cannot be removed using Remove-AppxPackage #"Microsoft.BioEnrollment" From fdca29a3d2afa1eb8dc41f32252945f519f6fcb3 Mon Sep 17 00:00:00 2001 From: Kye Davey Date: Wed, 21 Dec 2016 08:19:06 +1000 Subject: [PATCH 05/35] Update remove-default-apps.ps1 Addition of Caesars Slots game to Non-Microsoft apps for removal --- scripts/remove-default-apps.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index dd38986..419b5df 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -74,6 +74,7 @@ $apps = @( "DB6EA5DB.CyberLinkMediaSuiteEssentials" "Facebook.Facebook" "flaregamesGmbH.RoyalRevolt2" + "Playtika.CaesarsSlotsFreeCasino" # apps which cannot be removed using Remove-AppxPackage #"Microsoft.BioEnrollment" From f8439e861a577b31833de255569c3e62bb97e522 Mon Sep 17 00:00:00 2001 From: Kye Davey Date: Wed, 21 Dec 2016 08:57:52 +1000 Subject: [PATCH 06/35] Prevent "Suggested Applications" returning Addition of Registry key to disable "Suggested Applications". This wont remove existing suggested applications, however it will prevent new suggestions and the return of removed suggestions. --- scripts/remove-default-apps.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index 419b5df..b058d5d 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -3,6 +3,7 @@ # to remove certain Apps comment out the corresponding lines below. Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 +Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 echo "Elevating privileges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) @@ -95,3 +96,7 @@ foreach ($app in $apps) { where DisplayName -EQ $app | Remove-AppxProvisionedPackage -Online } + +# Prevents "Suggested Applications" returning +force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" +sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" "DisableWindowsConsumerFeatures" 1 From b72183952e1a488df58e3f7b592188546b62e3a4 Mon Sep 17 00:00:00 2001 From: Chirishman Date: Wed, 21 Dec 2016 17:14:55 -0500 Subject: [PATCH 07/35] Switch to full Chocolatey, use ScheduledJob Instead of depending on OneGet's unsupported, years out of date implementation, use that only to get the up-to-date version of Chocolatey. Schedule daily update to run as a PSScheduled Job, enforce that it should run elevated and let the implicit credentials used when executing the script authorize the job where the previous script threw an error if there was no local user with the explicitly configured name of "admin". This method requires PS 5.0 and up but since this script is for Windows 10 that is not a concern. --- utils/install-basic-software.ps1 | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/utils/install-basic-software.ps1 b/utils/install-basic-software.ps1 index 9566505..6c47646 100644 --- a/utils/install-basic-software.ps1 +++ b/utils/install-basic-software.ps1 @@ -32,16 +32,25 @@ $packages = @( echo "Setting up Chocolatey software package manager" Get-PackageProvider -Name chocolatey -Force +echo "Setting up Full Chocolatey Install" +Install-Package -Name Chocolatey -Force -ProviderName chocolatey +$chocopath = (Get-Package chocolatey | ?{$_.Name -eq "chocolatey"} | Select @{N="Source";E={((($a=($_.Source -split "\\"))[0..($a.length - 2)]) -join "\"),"Tools\chocolateyInstall" -join "\"}} | Select -ExpandProperty Source) +& $chocopath "upgrade all -y" +choco uninstall mm-choco.extension --all-versions +choco install chocolatey-core.extension --force + echo "Creating daily task to automatically upgrade Chocolatey packages" # adapted from https://blogs.technet.microsoft.com/heyscriptingguy/2013/11/23/using-scheduled-tasks-and-scheduled-jobs-in-powershell/ -$taskName = "Chocolatey Daily Upgrade" -$taskAction = New-ScheduledTaskAction –Execute C:\programdata\chocolatey\choco.exe -Argument "upgrade all -y" -$taskTrigger = New-ScheduledTaskTrigger -At 2am -Daily -$taskUser = "Admin" -Register-ScheduledTask –TaskName $taskName -Action $taskAction –Trigger $taskTrigger -User $taskUser +$ScheduledJob = @{ + Name = "Chocolatey Daily Upgrade" + ScriptBlock = {choco upgrade all -y} + Trigger = New-JobTrigger -Daily -at 2am + ScheduledJobOption = New-ScheduledJobOption -RunElevated -MultipleInstancePolicy StopExisting -RequireNetwork +} +Register-ScheduledJob @ScheduledJob echo "Installing Packages" -Install-Package -Name $packages -Force -ProviderName chocolatey +$packages | %{choco install $_ --force -y} echo "Installing Sysinternals Utilities to C:\Sysinternals" $download_uri = "https://download.sysinternals.com/files/SysinternalsSuite.zip" From 5b79b5c5bb456f33cd29acc2728bf765f6248cc1 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sun, 25 Dec 2016 18:20:02 +0100 Subject: [PATCH 08/35] Add option to disable game DVR --- scripts/optimize-user-interface.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/optimize-user-interface.ps1 b/scripts/optimize-user-interface.ps1 index 92f8db9..595d792 100644 --- a/scripts/optimize-user-interface.ps1 +++ b/scripts/optimize-user-interface.ps1 @@ -27,6 +27,10 @@ echo "Disable mouse pointer hiding" sp "HKCU:\Control Panel\Desktop" "UserPreferencesMask" ([byte[]](0x9e, 0x1e, 0x06, 0x80, 0x12, 0x00, 0x00, 0x00)) +echo "Disable Game DVR and Game Bar" +force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" +sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" "AllowgameDVR" 0 + echo "Disable easy access keyboard stuff" sp "HKCU:\Control Panel\Accessibility\StickyKeys" "Flags" "506" sp "HKCU:\Control Panel\Accessibility\Keyboard Response" "Flags" "122" From 35d160a0e859ca5a8dd5ea4f221e61a70e0dea50 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Wed, 28 Dec 2016 18:01:42 +0100 Subject: [PATCH 09/35] Add known issue about sysprep close #87 --- README.md | 5 +++ scripts/disable-services.ps1 | 68 ++++++++++++++++++------------------ 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 6721328..596d1a2 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,11 @@ has been discovered by BK from Atlanta: You may now disable the GeoLocation service again, the search box should remain functional. +### Sysprep will hang + +If you are deploying images with MDT and running these scripts, the sysprep +step will hang unless `dmwappushserivce` is active. + ## Interactivity The scripts are designed to run without any user-interaction. Modify them diff --git a/scripts/disable-services.ps1 b/scripts/disable-services.ps1 index 4af0d22..8aee7c5 100644 --- a/scripts/disable-services.ps1 +++ b/scripts/disable-services.ps1 @@ -1,34 +1,34 @@ -# Description: -# This script disables unwanted Windows services. If you do not want to disable -# certain services comment out the corresponding lines below. - -$services = @( - "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service - "DiagTrack" # Diagnostics Tracking Service - "dmwappushservice" # WAP Push Message Routing Service - "HomeGroupListener" # HomeGroup Listener - "HomeGroupProvider" # HomeGroup Provider - "lfsvc" # Geolocation Service - "MapsBroker" # Downloaded Maps Manager - "NetTcpPortSharing" # Net.Tcp Port Sharing Service - "RemoteAccess" # Routing and Remote Access - "RemoteRegistry" # Remote Registry - "SharedAccess" # Internet Connection Sharing (ICS) - "TrkWks" # Distributed Link Tracking Client - "WbioSrvc" # Windows Biometric Service - #"WlanSvc" # WLAN AutoConfig - "WMPNetworkSvc" # Windows Media Player Network Sharing Service - "wscsvc" # Windows Security Center Service - #"WSearch" # Windows Search - "XblAuthManager" # Xbox Live Auth Manager - "XblGameSave" # Xbox Live Game Save Service - "XboxNetApiSvc" # Xbox Live Networking Service - - # Services which cannot be disabled - #"WdNisSvc" -) - -foreach ($service in $services) { - echo "Trying to disable $service" - Get-Service -Name $service | Set-Service -StartupType Disabled -} +# Description: +# This script disables unwanted Windows services. If you do not want to disable +# certain services comment out the corresponding lines below. + +$services = @( + "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service + "DiagTrack" # Diagnostics Tracking Service + "dmwappushservice" # WAP Push Message Routing Service (see known issues) + "HomeGroupListener" # HomeGroup Listener + "HomeGroupProvider" # HomeGroup Provider + "lfsvc" # Geolocation Service + "MapsBroker" # Downloaded Maps Manager + "NetTcpPortSharing" # Net.Tcp Port Sharing Service + "RemoteAccess" # Routing and Remote Access + "RemoteRegistry" # Remote Registry + "SharedAccess" # Internet Connection Sharing (ICS) + "TrkWks" # Distributed Link Tracking Client + "WbioSrvc" # Windows Biometric Service + #"WlanSvc" # WLAN AutoConfig + "WMPNetworkSvc" # Windows Media Player Network Sharing Service + "wscsvc" # Windows Security Center Service + #"WSearch" # Windows Search + "XblAuthManager" # Xbox Live Auth Manager + "XblGameSave" # Xbox Live Game Save Service + "XboxNetApiSvc" # Xbox Live Networking Service + + # Services which cannot be disabled + #"WdNisSvc" +) + +foreach ($service in $services) { + echo "Trying to disable $service" + Get-Service -Name $service | Set-Service -StartupType Disabled +} From 4cac42c7bf77deb293974a19af7c2b1c188b0f5c Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Thu, 29 Dec 2016 15:20:53 +0100 Subject: [PATCH 10/35] Add note about xbox wireless adapter to known issues --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 596d1a2..e59a782 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,14 @@ functional. If you are deploying images with MDT and running these scripts, the sysprep step will hang unless `dmwappushserivce` is active. +### XBox Wireless Adapter + +Apprently running the stock `remove-default-apps` script will cause XBox +Wireless Adapters to stop functioning. I suspenc one should not remove the XBox +App when wanting to use one. But I haven't confirmed this yet, and there is a +workaround to re-enable it afterwards. See +[#78](https://github.com/W4RH4WK/Debloat-Windows-10/issues/78). + ## Interactivity The scripts are designed to run without any user-interaction. Modify them From cc415bdf650a4e1a6250bca3add6097b4f9fb263 Mon Sep 17 00:00:00 2001 From: Chirishman Date: Tue, 7 Feb 2017 16:40:41 -0500 Subject: [PATCH 11/35] Update install-basic-software.ps1 --- utils/install-basic-software.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/install-basic-software.ps1 b/utils/install-basic-software.ps1 index 6c47646..dce5478 100644 --- a/utils/install-basic-software.ps1 +++ b/utils/install-basic-software.ps1 @@ -36,7 +36,6 @@ echo "Setting up Full Chocolatey Install" Install-Package -Name Chocolatey -Force -ProviderName chocolatey $chocopath = (Get-Package chocolatey | ?{$_.Name -eq "chocolatey"} | Select @{N="Source";E={((($a=($_.Source -split "\\"))[0..($a.length - 2)]) -join "\"),"Tools\chocolateyInstall" -join "\"}} | Select -ExpandProperty Source) & $chocopath "upgrade all -y" -choco uninstall mm-choco.extension --all-versions choco install chocolatey-core.extension --force echo "Creating daily task to automatically upgrade Chocolatey packages" From ebc93a11c71afe75ac7a319bcf8e5d6d2e743f42 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Thu, 16 Feb 2017 08:45:29 +0100 Subject: [PATCH 12/35] Fix strange dashes in install-basic-software.ps1 ref #95 --- utils/install-basic-software.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/install-basic-software.ps1 b/utils/install-basic-software.ps1 index 9566505..11dab4f 100644 --- a/utils/install-basic-software.ps1 +++ b/utils/install-basic-software.ps1 @@ -35,10 +35,10 @@ Get-PackageProvider -Name chocolatey -Force echo "Creating daily task to automatically upgrade Chocolatey packages" # adapted from https://blogs.technet.microsoft.com/heyscriptingguy/2013/11/23/using-scheduled-tasks-and-scheduled-jobs-in-powershell/ $taskName = "Chocolatey Daily Upgrade" -$taskAction = New-ScheduledTaskAction –Execute C:\programdata\chocolatey\choco.exe -Argument "upgrade all -y" +$taskAction = New-ScheduledTaskAction -Execute C:\programdata\chocolatey\choco.exe -Argument "upgrade all -y" $taskTrigger = New-ScheduledTaskTrigger -At 2am -Daily $taskUser = "Admin" -Register-ScheduledTask –TaskName $taskName -Action $taskAction –Trigger $taskTrigger -User $taskUser +Register-ScheduledTask -TaskName $taskName -Action $taskAction -Trigger $taskTrigger -User $taskUser echo "Installing Packages" Install-Package -Name $packages -Force -ProviderName chocolatey From 7bc682f03b6448d5a40094a5856b96ef4b2b61a0 Mon Sep 17 00:00:00 2001 From: Miodrag Milic Date: Fri, 24 Feb 2017 13:35:36 +0100 Subject: [PATCH 13/35] removed Windows Defender tray icon --- scripts/disable-windows-defender.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/disable-windows-defender.ps1 b/scripts/disable-windows-defender.ps1 index ac38d6b..6a537dc 100644 --- a/scripts/disable-windows-defender.ps1 +++ b/scripts/disable-windows-defender.ps1 @@ -28,3 +28,7 @@ sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender\Real-Time Pro echo "Removing Windows Defender context menu item" si "HKLM:\SOFTWARE\Classes\CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32" "" + +echo "Removing Windows Defender tray icon" +rp HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\WindowsDefender -Name WindowsDefender -ea 0 +ps MSASCuiL -ea 0 | kill From 78387cfcb31232a0665ea0b1811d96c8cc9b9109 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sat, 25 Feb 2017 15:17:45 +0100 Subject: [PATCH 14/35] Also disable Windows Defender Services --- README.md | 2 ++ scripts/disable-windows-defender.ps1 | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e59a782..e50138f 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ Unblock PowerShell scripts and modules within this directory: 2. Edit the scripts to fit your need. 3. Run the scripts 4. `PS > Restart-Computer` +5. Run `disable-windows-defender.ps1` one more time. +6. `PS > Restart-Computer` ## Startmenu diff --git a/scripts/disable-windows-defender.ps1 b/scripts/disable-windows-defender.ps1 index ac38d6b..004cb94 100644 --- a/scripts/disable-windows-defender.ps1 +++ b/scripts/disable-windows-defender.ps1 @@ -1,7 +1,13 @@ # Description: -# This script disables Windows Defender. +# This script disables Windows Defender. Run it once (will throw errors), then +# reboot, run it again (this time no errors should occur) followed by another +# reboot. Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 +Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 + +echo "Elevating priviledges for this process" +do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) $tasks = @( "\Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" @@ -26,5 +32,14 @@ sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender" "DisableRout force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender\Real-Time Protection" sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender\Real-Time Protection" "DisableRealtimeMonitoring" 1 +echo "Disabling Windows Defender Services" +Takeown-Registry("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend") +sp "HKLM:\SYSTEM\CurrentControlSet\Services\WinDefend" "Start" 4 +sp "HKLM:\SYSTEM\CurrentControlSet\Services\WinDefend" "AutorunsDisabled" 3 +sp "HKLM:\SYSTEM\CurrentControlSet\Services\WdNisSvc" "Start" 4 +sp "HKLM:\SYSTEM\CurrentControlSet\Services\WdNisSvc" "AutorunsDisabled" 3 +sp "HKLM:\SYSTEM\CurrentControlSet\Services\Sense" "Start" 4 +sp "HKLM:\SYSTEM\CurrentControlSet\Services\Sense" "AutorunsDisabled" 3 + echo "Removing Windows Defender context menu item" si "HKLM:\SOFTWARE\Classes\CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32" "" From 6281c87a69f5322b5fc1061ec82f0c95d9f7ffe6 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sun, 5 Mar 2017 08:13:42 +0100 Subject: [PATCH 15/35] Add newly discovered telemetry endpoint to list close #100 --- scripts/block-telemetry.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/block-telemetry.ps1 b/scripts/block-telemetry.ps1 index b0460b4..ed4a517 100644 --- a/scripts/block-telemetry.ps1 +++ b/scripts/block-telemetry.ps1 @@ -11,6 +11,7 @@ sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0 echo "Adding telemetry domains to hosts file" $hosts_file = "$env:systemroot\System32\drivers\etc\hosts" $domains = @( + "184-86-53-99.deploy.static.akamaitechnologies.com" "a-0001.a-msedge.net" "a-0002.a-msedge.net" "a-0003.a-msedge.net" @@ -161,6 +162,7 @@ $ips = @( "134.170.30.202" "137.116.81.24" "157.56.106.189" + "184.86.53.99" "2.22.61.43" "2.22.61.66" "204.79.197.200" From 28505a5d86af6a086622be0ff21e285328b9c094 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sun, 5 Mar 2017 08:14:38 +0100 Subject: [PATCH 16/35] Fix Registry path for disabling Defender --- scripts/disable-windows-defender.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/disable-windows-defender.ps1 b/scripts/disable-windows-defender.ps1 index 56baae1..b1cd43e 100644 --- a/scripts/disable-windows-defender.ps1 +++ b/scripts/disable-windows-defender.ps1 @@ -45,4 +45,4 @@ echo "Removing Windows Defender context menu item" si "HKLM:\SOFTWARE\Classes\CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32" "" echo "Removing Windows Defender GUI / tray from autorun" -rp "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\WindowsDefender" "WindowsDefender" -ea 0 +rp "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "WindowsDefender" -ea 0 From 900fde4db20e4ed14257f89ae3d7a6428779eb42 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sun, 5 Mar 2017 08:22:31 +0100 Subject: [PATCH 17/35] Rephrase some parts of the README for clarity ref #99 --- README.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e50138f..01e64d2 100644 --- a/README.md +++ b/README.md @@ -3,21 +3,30 @@ This project collects Powershell scripts which help to *debloat* Windows 10, tweak common settings and install basic software components. -I develop those scripts on a Windows 10 Professional 64-Bit (English) virtual -machine. Please let me know if you encounter any issues with other Windows 10 -versions. +I test these scripts on a Windows 10 Professional 64-Bit (English) virtual +machine. Please let me know if you encounter any issues. Home Edition and +different languages are not supported. These scripts are intended for +tech-savvy administrators, who know what they are doing and just want to +automate this phase of their setup. If this profile does not fit you, I +recommend using a different (more interactive) tool -- and there are a lot of +them out there. + +**There is no undo**, I recommend only using these scripts on a fresh +installation (including Windows Updates). Test everything after running them +before doing anything else. Also there is no guarantee that everything will +work after future updates since I cannot predict what Microsoft will do next. -Home Edition and different languages are not supported. Let me know of you fork -this repo for fixing Home Edition or a different language. +## Interactivity -Note that **there is no undo**, I recommend only using these scripts on a fresh -install (including updates). Test everything after running them before -continuing with something else. Also there is no guarantee that everything will -work after future updates since I cannot predict what Microsoft will do next. +The scripts are designed to run without any user-interaction. Modify them +beforehand. If you want a more interactive approach check out +[DisableWinTracking](https://github.com/10se1ucgo/DisableWinTracking) from +[10se1ucgo](https://github.com/10se1ucgo). ## Download Latest Version -Code located in the `master` branch is under development (for now). +Code located in the `master` branch is always considered under development, but +you'll probably want the most recent version anyway. - [Download [zip]](https://github.com/W4RH4WK/Debloat-Windows-10/archive/master.zip) @@ -86,13 +95,6 @@ App when wanting to use one. But I haven't confirmed this yet, and there is a workaround to re-enable it afterwards. See [#78](https://github.com/W4RH4WK/Debloat-Windows-10/issues/78). -## Interactivity - -The scripts are designed to run without any user-interaction. Modify them -beforehand. If you want a more interactive approach check out -[DisableWinTracking](https://github.com/10se1ucgo/DisableWinTracking) from -[10se1ucgo](https://github.com/10se1ucgo). - ## Liability **All scripts are provided as is and you use them at your own risk.** From 40497d19b6120315d2acf093ca3088a9bdef91d2 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Fri, 10 Mar 2017 09:47:08 +0100 Subject: [PATCH 18/35] Disable new ShowSyncProviderNotifications explorer setting --- scripts/optimize-user-interface.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/optimize-user-interface.ps1 b/scripts/optimize-user-interface.ps1 index 595d792..c7d8b67 100644 --- a/scripts/optimize-user-interface.ps1 +++ b/scripts/optimize-user-interface.ps1 @@ -44,6 +44,7 @@ echo "Setting folder view options" sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Hidden" 1 sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideFileExt" 0 sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideDrivesWithNoMedia" 0 +sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ShowSyncProviderNotifications" 0 echo "Setting default explorer view to This PC" sp "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "LaunchTo" 1 From 55efa4fb8c33404c13781c131c51235582284423 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Mon, 20 Mar 2017 10:42:49 +0100 Subject: [PATCH 19/35] Add note about PowerShell with administrator priviledges ref #103 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 01e64d2..bb15cc2 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,9 @@ Unblock PowerShell scripts and modules within this directory: 1. Install all available updates for your system. 2. Edit the scripts to fit your need. -3. Run the scripts +3. Run the scripts from a PowerShell with administrator priviledges (Explorer + `Files > Open Windows PowerShell > Open Windows PowerShell as + administrator`) 4. `PS > Restart-Computer` 5. Run `disable-windows-defender.ps1` one more time. 6. `PS > Restart-Computer` From 8719e8db23be651932c073a1a7f1c7d7a103425a Mon Sep 17 00:00:00 2001 From: angelsl Date: Mon, 10 Apr 2017 21:50:30 +0800 Subject: [PATCH 20/35] Don't silently remove OneDrive directory --- scripts/remove-onedrive.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/remove-onedrive.ps1 b/scripts/remove-onedrive.ps1 index 9c83a59..49ecd41 100644 --- a/scripts/remove-onedrive.ps1 +++ b/scripts/remove-onedrive.ps1 @@ -19,7 +19,6 @@ if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") { echo "Removing OneDrive leftovers" rm -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" rm -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" -rm -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" rm -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp" echo "Disable OneDrive via Group Policies" From f1f63f49a4934b5ac65eeebc74f4eb8e760c933a Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sat, 15 Apr 2017 23:43:19 +0200 Subject: [PATCH 21/35] Add note about creators update --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index bb15cc2..4e7ca10 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Debloat Windows 10 +**Note about Creators Update:** These scripts have *not* been tested with the +Creators Update. Anything may happen, be prepared. I'll look into relevant +changes and recent issues when the update is released / pushed on to everyone. + This project collects Powershell scripts which help to *debloat* Windows 10, tweak common settings and install basic software components. From d3bf3e3749b1518fad8e181fdd4a673233ded0c4 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sat, 22 Apr 2017 23:46:17 +0200 Subject: [PATCH 22/35] Fix lineendings ref #109 --- .gitattributes | 1 + lib/take-own.psm1 | 212 +++++++-------- scripts/experimental_unfuckery.ps1 | 94 +++---- utils/boot-advanced-startup.bat | 6 +- utils/dark-theme.reg | 14 +- utils/disable-scheduled-tasks.ps1 | 414 ++++++++++++++--------------- utils/enable-god-mode.ps1 | 38 +-- 7 files changed, 390 insertions(+), 389 deletions(-) diff --git a/.gitattributes b/.gitattributes index 21107f3..a021040 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ * text=auto +*.bat text eol=crlf *.ps1 text eol=crlf *.psm1 text eol=crlf *.reg text eol=crlf diff --git a/lib/take-own.psm1 b/lib/take-own.psm1 index 6509188..a4b9a9b 100644 --- a/lib/take-own.psm1 +++ b/lib/take-own.psm1 @@ -1,106 +1,106 @@ -function Takeown-Registry($key) { - # TODO does not work for all root keys yet - switch ($key.split('\')[0]) { - "HKEY_CLASSES_ROOT" { - $reg = [Microsoft.Win32.Registry]::ClassesRoot - $key = $key.substring(18) - } - "HKEY_CURRENT_USER" { - $reg = [Microsoft.Win32.Registry]::CurrentUser - $key = $key.substring(18) - } - "HKEY_LOCAL_MACHINE" { - $reg = [Microsoft.Win32.Registry]::LocalMachine - $key = $key.substring(19) - } - } - - # get administraor group - $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") - $admins = $admins.Translate([System.Security.Principal.NTAccount]) - - # set owner - $key = $reg.OpenSubKey($key, "ReadWriteSubTree", "TakeOwnership") - $acl = $key.GetAccessControl() - $acl.SetOwner($admins) - $key.SetAccessControl($acl) - - # set FullControl - $acl = $key.GetAccessControl() - $rule = New-Object System.Security.AccessControl.RegistryAccessRule($admins, "FullControl", "Allow") - $acl.SetAccessRule($rule) - $key.SetAccessControl($acl) -} - -function Takeown-File($path) { - takeown.exe /A /F $path - $acl = Get-Acl $path - - # get administraor group - $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") - $admins = $admins.Translate([System.Security.Principal.NTAccount]) - - # add NT Authority\SYSTEM - $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admins, "FullControl", "None", "None", "Allow") - $acl.AddAccessRule($rule) - - Set-Acl -Path $path -AclObject $acl -} - -function Takeown-Folder($path) { - Takeown-File $path - foreach ($item in Get-ChildItem $path) { - if (Test-Path $item -PathType Container) { - Takeown-Folder $item.FullName - } else { - Takeown-File $item.FullName - } - } -} - -function Elevate-Privileges { - param($Privilege) - $Definition = @" - using System; - using System.Runtime.InteropServices; - - public class AdjPriv { - [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] - internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr rele); - - [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] - internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok); - - [DllImport("advapi32.dll", SetLastError = true)] - internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid); - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - internal struct TokPriv1Luid { - public int Count; - public long Luid; - public int Attr; - } - - internal const int SE_PRIVILEGE_ENABLED = 0x00000002; - internal const int TOKEN_QUERY = 0x00000008; - internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020; - - public static bool EnablePrivilege(long processHandle, string privilege) { - bool retVal; - TokPriv1Luid tp; - IntPtr hproc = new IntPtr(processHandle); - IntPtr htok = IntPtr.Zero; - retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok); - tp.Count = 1; - tp.Luid = 0; - tp.Attr = SE_PRIVILEGE_ENABLED; - retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid); - retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero); - return retVal; - } - } -"@ - $ProcessHandle = (Get-Process -id $pid).Handle - $type = Add-Type $definition -PassThru - $type[0]::EnablePrivilege($processHandle, $Privilege) -} +function Takeown-Registry($key) { + # TODO does not work for all root keys yet + switch ($key.split('\')[0]) { + "HKEY_CLASSES_ROOT" { + $reg = [Microsoft.Win32.Registry]::ClassesRoot + $key = $key.substring(18) + } + "HKEY_CURRENT_USER" { + $reg = [Microsoft.Win32.Registry]::CurrentUser + $key = $key.substring(18) + } + "HKEY_LOCAL_MACHINE" { + $reg = [Microsoft.Win32.Registry]::LocalMachine + $key = $key.substring(19) + } + } + + # get administraor group + $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") + $admins = $admins.Translate([System.Security.Principal.NTAccount]) + + # set owner + $key = $reg.OpenSubKey($key, "ReadWriteSubTree", "TakeOwnership") + $acl = $key.GetAccessControl() + $acl.SetOwner($admins) + $key.SetAccessControl($acl) + + # set FullControl + $acl = $key.GetAccessControl() + $rule = New-Object System.Security.AccessControl.RegistryAccessRule($admins, "FullControl", "Allow") + $acl.SetAccessRule($rule) + $key.SetAccessControl($acl) +} + +function Takeown-File($path) { + takeown.exe /A /F $path + $acl = Get-Acl $path + + # get administraor group + $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") + $admins = $admins.Translate([System.Security.Principal.NTAccount]) + + # add NT Authority\SYSTEM + $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admins, "FullControl", "None", "None", "Allow") + $acl.AddAccessRule($rule) + + Set-Acl -Path $path -AclObject $acl +} + +function Takeown-Folder($path) { + Takeown-File $path + foreach ($item in Get-ChildItem $path) { + if (Test-Path $item -PathType Container) { + Takeown-Folder $item.FullName + } else { + Takeown-File $item.FullName + } + } +} + +function Elevate-Privileges { + param($Privilege) + $Definition = @" + using System; + using System.Runtime.InteropServices; + + public class AdjPriv { + [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] + internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr rele); + + [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] + internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok); + + [DllImport("advapi32.dll", SetLastError = true)] + internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid); + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + internal struct TokPriv1Luid { + public int Count; + public long Luid; + public int Attr; + } + + internal const int SE_PRIVILEGE_ENABLED = 0x00000002; + internal const int TOKEN_QUERY = 0x00000008; + internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020; + + public static bool EnablePrivilege(long processHandle, string privilege) { + bool retVal; + TokPriv1Luid tp; + IntPtr hproc = new IntPtr(processHandle); + IntPtr htok = IntPtr.Zero; + retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok); + tp.Count = 1; + tp.Luid = 0; + tp.Attr = SE_PRIVILEGE_ENABLED; + retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid); + retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero); + return retVal; + } + } +"@ + $ProcessHandle = (Get-Process -id $pid).Handle + $type = Add-Type $definition -PassThru + $type[0]::EnablePrivilege($processHandle, $Privilege) +} diff --git a/scripts/experimental_unfuckery.ps1 b/scripts/experimental_unfuckery.ps1 index e8ff8cb..3761fc4 100644 --- a/scripts/experimental_unfuckery.ps1 +++ b/scripts/experimental_unfuckery.ps1 @@ -1,47 +1,47 @@ -# Description: -# This script remove strang looking stuff which will probably result in a break -# of your system. It should not be used unless you want to test out a few -# things. It is named `experimental_unfuckery.ps1` for a reason. - -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 - -echo "Elevating priviledges for this process" -do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) - -echo "Force removing system apps" -$needles = @( - #"Anytime" - "BioEnrollment" - #"Browser" - "ContactSupport" - #"Cortana" # This will disable startmenu search. - #"Defender" - "Feedback" - "Flash" - "Gaming" - #"InternetExplorer" - #"Maps" - "OneDrive" - #"Wallet" - #"Xbox" # This will result in a bootloop since upgrade 1511 -) - -foreach ($needle in $needles) { - echo "Trying to remove all packages containing $needle" - - $pkgs = (ls "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" | - where Name -Like "*$needle*") - - foreach ($pkg in $pkgs) { - $pkgname = $pkg.Name.split('\')[-1] - - Takeown-Registry($pkg.Name) - Takeown-Registry($pkg.Name + "\Owners") - - Set-ItemProperty -Path ("HKLM:" + $pkg.Name.Substring(18)) -Name Visibility -Value 1 - New-ItemProperty -Path ("HKLM:" + $pkg.Name.Substring(18)) -Name DefVis -PropertyType DWord -Value 2 - Remove-Item -Path ("HKLM:" + $pkg.Name.Substring(18) + "\Owners") - - dism.exe /Online /Remove-Package /PackageName:$pkgname /NoRestart - } -} +# Description: +# This script remove strang looking stuff which will probably result in a break +# of your system. It should not be used unless you want to test out a few +# things. It is named `experimental_unfuckery.ps1` for a reason. + +Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 + +echo "Elevating priviledges for this process" +do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) + +echo "Force removing system apps" +$needles = @( + #"Anytime" + "BioEnrollment" + #"Browser" + "ContactSupport" + #"Cortana" # This will disable startmenu search. + #"Defender" + "Feedback" + "Flash" + "Gaming" + #"InternetExplorer" + #"Maps" + "OneDrive" + #"Wallet" + #"Xbox" # This will result in a bootloop since upgrade 1511 +) + +foreach ($needle in $needles) { + echo "Trying to remove all packages containing $needle" + + $pkgs = (ls "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" | + where Name -Like "*$needle*") + + foreach ($pkg in $pkgs) { + $pkgname = $pkg.Name.split('\')[-1] + + Takeown-Registry($pkg.Name) + Takeown-Registry($pkg.Name + "\Owners") + + Set-ItemProperty -Path ("HKLM:" + $pkg.Name.Substring(18)) -Name Visibility -Value 1 + New-ItemProperty -Path ("HKLM:" + $pkg.Name.Substring(18)) -Name DefVis -PropertyType DWord -Value 2 + Remove-Item -Path ("HKLM:" + $pkg.Name.Substring(18) + "\Owners") + + dism.exe /Online /Remove-Package /PackageName:$pkgname /NoRestart + } +} diff --git a/utils/boot-advanced-startup.bat b/utils/boot-advanced-startup.bat index aa268d0..e35e9f6 100644 --- a/utils/boot-advanced-startup.bat +++ b/utils/boot-advanced-startup.bat @@ -1,3 +1,3 @@ -@echo off - -shutdown /o /r /t 00 +@echo off + +shutdown /o /r /t 00 diff --git a/utils/dark-theme.reg b/utils/dark-theme.reg index 323a4d9..0232c91 100644 --- a/utils/dark-theme.reg +++ b/utils/dark-theme.reg @@ -1,7 +1,7 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] -"AppsUseLightTheme"=dword:00000000 - -[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] -"AppsUseLightTheme"=dword:00000000 +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] +"AppsUseLightTheme"=dword:00000000 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] +"AppsUseLightTheme"=dword:00000000 diff --git a/utils/disable-scheduled-tasks.ps1 b/utils/disable-scheduled-tasks.ps1 index 29879ea..30d599b 100644 --- a/utils/disable-scheduled-tasks.ps1 +++ b/utils/disable-scheduled-tasks.ps1 @@ -1,207 +1,207 @@ -# Description: -# This script will disable certain scheduled tasks. Work in progress! - -$tasks = @( - # Windows base scheduled tasks - "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319" - "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64" - "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical" - "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical" - - #"\Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Automated)" - #"\Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Manual)" - - #"\Microsoft\Windows\AppID\EDP Policy Manager" - #"\Microsoft\Windows\AppID\PolicyConverter" - "\Microsoft\Windows\AppID\SmartScreenSpecific" - #"\Microsoft\Windows\AppID\VerifiedPublisherCertStoreCheck" - - "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" - "\Microsoft\Windows\Application Experience\ProgramDataUpdater" - #"\Microsoft\Windows\Application Experience\StartupAppTask" - - #"\Microsoft\Windows\ApplicationData\CleanupTemporaryState" - #"\Microsoft\Windows\ApplicationData\DsSvcCleanup" - - #"\Microsoft\Windows\AppxDeploymentClient\Pre-staged app cleanup" - - "\Microsoft\Windows\Autochk\Proxy" - - #"\Microsoft\Windows\Bluetooth\UninstallDeviceTask" - - #"\Microsoft\Windows\CertificateServicesClient\AikCertEnrollTask" - #"\Microsoft\Windows\CertificateServicesClient\KeyPreGenTask" - #"\Microsoft\Windows\CertificateServicesClient\SystemTask" - #"\Microsoft\Windows\CertificateServicesClient\UserTask" - #"\Microsoft\Windows\CertificateServicesClient\UserTask-Roam" - - #"\Microsoft\Windows\Chkdsk\ProactiveScan" - - #"\Microsoft\Windows\Clip\License Validation" - - "\Microsoft\Windows\CloudExperienceHost\CreateObjectTask" - - "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" - "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" - "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" - - #"\Microsoft\Windows\Data Integrity Scan\Data Integrity Scan" - #"\Microsoft\Windows\Data Integrity Scan\Data Integrity Scan for Crash Recovery" - - #"\Microsoft\Windows\Defrag\ScheduledDefrag" - - #"\Microsoft\Windows\Diagnosis\Scheduled" - - #"\Microsoft\Windows\DiskCleanup\SilentCleanup" - - "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" - #"\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticResolver" - - #"\Microsoft\Windows\DiskFootprint\Diagnostics" - - "\Microsoft\Windows\Feedback\Siuf\DmClient" - - #"\Microsoft\Windows\File Classification Infrastructure\Property Definition Sync" - - #"\Microsoft\Windows\FileHistory\File History (maintenance mode)" - - #"\Microsoft\Windows\LanguageComponentsInstaller\Installation" - #"\Microsoft\Windows\LanguageComponentsInstaller\Uninstallation" - - #"\Microsoft\Windows\Location\Notifications" - #"\Microsoft\Windows\Location\WindowsActionDialog" - - #"\Microsoft\Windows\Maintenance\WinSAT" - - #"\Microsoft\Windows\Maps\MapsToastTask" - #"\Microsoft\Windows\Maps\MapsUpdateTask" - - #"\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents" - #"\Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic" - - "\Microsoft\Windows\Mobile Broadband Accounts\MNO Metadata Parser" - - #"\Microsoft\Windows\MUI\LPRemove" - - #"\Microsoft\Windows\Multimedia\SystemSoundsService" - - #"\Microsoft\Windows\NetCfg\BindingWorkItemQueueHandler" - - #"\Microsoft\Windows\NetTrace\GatherNetworkInfo" - - #"\Microsoft\Windows\Offline Files\Background Synchronization" - #"\Microsoft\Windows\Offline Files\Logon Synchronization" - - #"\Microsoft\Windows\PI\Secure-Boot-Update" - #"\Microsoft\Windows\PI\Sqm-Tasks" - - #"\Microsoft\Windows\Plug and Play\Device Install Group Policy" - #"\Microsoft\Windows\Plug and Play\Device Install Reboot Required" - #"\Microsoft\Windows\Plug and Play\Plug and Play Cleanup" - #"\Microsoft\Windows\Plug and Play\Sysprep Generalize Drivers" - - #"\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem" - - #"\Microsoft\Windows\Ras\MobilityManager" - - #"\Microsoft\Windows\RecoveryEnvironment\VerifyWinRE" - - #"\Microsoft\Windows\Registry\RegIdleBackup" - - #"\Microsoft\Windows\RemoteAssistance\RemoteAssistanceTask" - - #"\Microsoft\Windows\RemovalTools\MRT_HB" - - #"\Microsoft\Windows\Servicing\StartComponentCleanup" - - #"\Microsoft\Windows\SettingSync\NetworkStateChangeTask" - - #"\Microsoft\Windows\Shell\CreateObjectTask" - #"\Microsoft\Windows\Shell\FamilySafetyMonitor" - #"\Microsoft\Windows\Shell\FamilySafetyRefresh" - #"\Microsoft\Windows\Shell\IndexerAutomaticMaintenance" - - #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" - #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskLogon" - #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskNetwork" - - #"\Microsoft\Windows\SpacePort\SpaceAgentTask" - - #"\Microsoft\Windows\Sysmain\HybridDriveCachePrepopulate" - #"\Microsoft\Windows\Sysmain\HybridDriveCacheRebalance" - #"\Microsoft\Windows\Sysmain\ResPriStaticDbSync" - #"\Microsoft\Windows\Sysmain\WsSwapAssessmentTask" - - #"\Microsoft\Windows\SystemRestore\SR" - - #"\Microsoft\Windows\Task Manager\Interactive" - - #"\Microsoft\Windows\TextServicesFramework\MsCtfMonitor" - - #"\Microsoft\Windows\Time Synchronization\ForceSynchronizeTime" - #"\Microsoft\Windows\Time Synchronization\SynchronizeTime" - - #"\Microsoft\Windows\Time Zone\SynchronizeTimeZone" - - #"\Microsoft\Windows\TPM\Tpm-HASCertRetr" - #"\Microsoft\Windows\TPM\Tpm-Maintenance" - - #"\Microsoft\Windows\UpdateOrchestrator\Maintenance Install" - #"\Microsoft\Windows\UpdateOrchestrator\Policy Install" - #"\Microsoft\Windows\UpdateOrchestrator\Reboot" - #"\Microsoft\Windows\UpdateOrchestrator\Resume On Boot" - #"\Microsoft\Windows\UpdateOrchestrator\Schedule Scan" - #"\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_Display" - #"\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_ReadyToReboot" - - #"\Microsoft\Windows\UPnP\UPnPHostConfig" - - #"\Microsoft\Windows\User Profile Service\HiveUploadTask" - - #"\Microsoft\Windows\WCM\WiFiTask" - - #"\Microsoft\Windows\WDI\ResolutionHost" - - "\Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" - "\Microsoft\Windows\Windows Defender\Windows Defender Cleanup" - "\Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" - "\Microsoft\Windows\Windows Defender\Windows Defender Verification" - - "\Microsoft\Windows\Windows Error Reporting\QueueReporting" - - #"\Microsoft\Windows\Windows Filtering Platform\BfeOnServiceStartTypeChange" - - #"\Microsoft\Windows\Windows Media Sharing\UpdateLibrary" - - #"\Microsoft\Windows\WindowsColorSystem\Calibration Loader" - - #"\Microsoft\Windows\WindowsUpdate\Automatic App Update" - #"\Microsoft\Windows\WindowsUpdate\Scheduled Start" - #"\Microsoft\Windows\WindowsUpdate\sih" - #"\Microsoft\Windows\WindowsUpdate\sihboot" - - #"\Microsoft\Windows\Wininet\CacheTask" - - #"\Microsoft\Windows\WOF\WIM-Hash-Management" - #"\Microsoft\Windows\WOF\WIM-Hash-Validation" - - #"\Microsoft\Windows\Work Folders\Work Folders Logon Synchronization" - #"\Microsoft\Windows\Work Folders\Work Folders Maintenance Work" - - #"\Microsoft\Windows\Workplace Join\Automatic-Device-Join" - - #"\Microsoft\Windows\WS\License Validation" - #"\Microsoft\Windows\WS\WSTask" - - # Scheduled tasks which cannot be disabled - #"\Microsoft\Windows\Device Setup\Metadata Refresh" - #"\Microsoft\Windows\SettingSync\BackgroundUploadTask" -) - -foreach ($task in $tasks) { - $parts = $task.split('\') - $name = $parts[-1] - $path = $parts[0..($parts.length-2)] -join '\' - - Disable-ScheduledTask -TaskName "$name" -TaskPath "$path" -} +# Description: +# This script will disable certain scheduled tasks. Work in progress! + +$tasks = @( + # Windows base scheduled tasks + "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319" + "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64" + "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical" + "\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical" + + #"\Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Automated)" + #"\Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Manual)" + + #"\Microsoft\Windows\AppID\EDP Policy Manager" + #"\Microsoft\Windows\AppID\PolicyConverter" + "\Microsoft\Windows\AppID\SmartScreenSpecific" + #"\Microsoft\Windows\AppID\VerifiedPublisherCertStoreCheck" + + "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" + "\Microsoft\Windows\Application Experience\ProgramDataUpdater" + #"\Microsoft\Windows\Application Experience\StartupAppTask" + + #"\Microsoft\Windows\ApplicationData\CleanupTemporaryState" + #"\Microsoft\Windows\ApplicationData\DsSvcCleanup" + + #"\Microsoft\Windows\AppxDeploymentClient\Pre-staged app cleanup" + + "\Microsoft\Windows\Autochk\Proxy" + + #"\Microsoft\Windows\Bluetooth\UninstallDeviceTask" + + #"\Microsoft\Windows\CertificateServicesClient\AikCertEnrollTask" + #"\Microsoft\Windows\CertificateServicesClient\KeyPreGenTask" + #"\Microsoft\Windows\CertificateServicesClient\SystemTask" + #"\Microsoft\Windows\CertificateServicesClient\UserTask" + #"\Microsoft\Windows\CertificateServicesClient\UserTask-Roam" + + #"\Microsoft\Windows\Chkdsk\ProactiveScan" + + #"\Microsoft\Windows\Clip\License Validation" + + "\Microsoft\Windows\CloudExperienceHost\CreateObjectTask" + + "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" + "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" + "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" + + #"\Microsoft\Windows\Data Integrity Scan\Data Integrity Scan" + #"\Microsoft\Windows\Data Integrity Scan\Data Integrity Scan for Crash Recovery" + + #"\Microsoft\Windows\Defrag\ScheduledDefrag" + + #"\Microsoft\Windows\Diagnosis\Scheduled" + + #"\Microsoft\Windows\DiskCleanup\SilentCleanup" + + "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" + #"\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticResolver" + + #"\Microsoft\Windows\DiskFootprint\Diagnostics" + + "\Microsoft\Windows\Feedback\Siuf\DmClient" + + #"\Microsoft\Windows\File Classification Infrastructure\Property Definition Sync" + + #"\Microsoft\Windows\FileHistory\File History (maintenance mode)" + + #"\Microsoft\Windows\LanguageComponentsInstaller\Installation" + #"\Microsoft\Windows\LanguageComponentsInstaller\Uninstallation" + + #"\Microsoft\Windows\Location\Notifications" + #"\Microsoft\Windows\Location\WindowsActionDialog" + + #"\Microsoft\Windows\Maintenance\WinSAT" + + #"\Microsoft\Windows\Maps\MapsToastTask" + #"\Microsoft\Windows\Maps\MapsUpdateTask" + + #"\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents" + #"\Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic" + + "\Microsoft\Windows\Mobile Broadband Accounts\MNO Metadata Parser" + + #"\Microsoft\Windows\MUI\LPRemove" + + #"\Microsoft\Windows\Multimedia\SystemSoundsService" + + #"\Microsoft\Windows\NetCfg\BindingWorkItemQueueHandler" + + #"\Microsoft\Windows\NetTrace\GatherNetworkInfo" + + #"\Microsoft\Windows\Offline Files\Background Synchronization" + #"\Microsoft\Windows\Offline Files\Logon Synchronization" + + #"\Microsoft\Windows\PI\Secure-Boot-Update" + #"\Microsoft\Windows\PI\Sqm-Tasks" + + #"\Microsoft\Windows\Plug and Play\Device Install Group Policy" + #"\Microsoft\Windows\Plug and Play\Device Install Reboot Required" + #"\Microsoft\Windows\Plug and Play\Plug and Play Cleanup" + #"\Microsoft\Windows\Plug and Play\Sysprep Generalize Drivers" + + #"\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem" + + #"\Microsoft\Windows\Ras\MobilityManager" + + #"\Microsoft\Windows\RecoveryEnvironment\VerifyWinRE" + + #"\Microsoft\Windows\Registry\RegIdleBackup" + + #"\Microsoft\Windows\RemoteAssistance\RemoteAssistanceTask" + + #"\Microsoft\Windows\RemovalTools\MRT_HB" + + #"\Microsoft\Windows\Servicing\StartComponentCleanup" + + #"\Microsoft\Windows\SettingSync\NetworkStateChangeTask" + + #"\Microsoft\Windows\Shell\CreateObjectTask" + #"\Microsoft\Windows\Shell\FamilySafetyMonitor" + #"\Microsoft\Windows\Shell\FamilySafetyRefresh" + #"\Microsoft\Windows\Shell\IndexerAutomaticMaintenance" + + #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" + #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskLogon" + #"\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskNetwork" + + #"\Microsoft\Windows\SpacePort\SpaceAgentTask" + + #"\Microsoft\Windows\Sysmain\HybridDriveCachePrepopulate" + #"\Microsoft\Windows\Sysmain\HybridDriveCacheRebalance" + #"\Microsoft\Windows\Sysmain\ResPriStaticDbSync" + #"\Microsoft\Windows\Sysmain\WsSwapAssessmentTask" + + #"\Microsoft\Windows\SystemRestore\SR" + + #"\Microsoft\Windows\Task Manager\Interactive" + + #"\Microsoft\Windows\TextServicesFramework\MsCtfMonitor" + + #"\Microsoft\Windows\Time Synchronization\ForceSynchronizeTime" + #"\Microsoft\Windows\Time Synchronization\SynchronizeTime" + + #"\Microsoft\Windows\Time Zone\SynchronizeTimeZone" + + #"\Microsoft\Windows\TPM\Tpm-HASCertRetr" + #"\Microsoft\Windows\TPM\Tpm-Maintenance" + + #"\Microsoft\Windows\UpdateOrchestrator\Maintenance Install" + #"\Microsoft\Windows\UpdateOrchestrator\Policy Install" + #"\Microsoft\Windows\UpdateOrchestrator\Reboot" + #"\Microsoft\Windows\UpdateOrchestrator\Resume On Boot" + #"\Microsoft\Windows\UpdateOrchestrator\Schedule Scan" + #"\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_Display" + #"\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_ReadyToReboot" + + #"\Microsoft\Windows\UPnP\UPnPHostConfig" + + #"\Microsoft\Windows\User Profile Service\HiveUploadTask" + + #"\Microsoft\Windows\WCM\WiFiTask" + + #"\Microsoft\Windows\WDI\ResolutionHost" + + "\Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" + "\Microsoft\Windows\Windows Defender\Windows Defender Cleanup" + "\Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" + "\Microsoft\Windows\Windows Defender\Windows Defender Verification" + + "\Microsoft\Windows\Windows Error Reporting\QueueReporting" + + #"\Microsoft\Windows\Windows Filtering Platform\BfeOnServiceStartTypeChange" + + #"\Microsoft\Windows\Windows Media Sharing\UpdateLibrary" + + #"\Microsoft\Windows\WindowsColorSystem\Calibration Loader" + + #"\Microsoft\Windows\WindowsUpdate\Automatic App Update" + #"\Microsoft\Windows\WindowsUpdate\Scheduled Start" + #"\Microsoft\Windows\WindowsUpdate\sih" + #"\Microsoft\Windows\WindowsUpdate\sihboot" + + #"\Microsoft\Windows\Wininet\CacheTask" + + #"\Microsoft\Windows\WOF\WIM-Hash-Management" + #"\Microsoft\Windows\WOF\WIM-Hash-Validation" + + #"\Microsoft\Windows\Work Folders\Work Folders Logon Synchronization" + #"\Microsoft\Windows\Work Folders\Work Folders Maintenance Work" + + #"\Microsoft\Windows\Workplace Join\Automatic-Device-Join" + + #"\Microsoft\Windows\WS\License Validation" + #"\Microsoft\Windows\WS\WSTask" + + # Scheduled tasks which cannot be disabled + #"\Microsoft\Windows\Device Setup\Metadata Refresh" + #"\Microsoft\Windows\SettingSync\BackgroundUploadTask" +) + +foreach ($task in $tasks) { + $parts = $task.split('\') + $name = $parts[-1] + $path = $parts[0..($parts.length-2)] -join '\' + + Disable-ScheduledTask -TaskName "$name" -TaskPath "$path" +} diff --git a/utils/enable-god-mode.ps1 b/utils/enable-god-mode.ps1 index 8a1d1d8..4e5a2ac 100644 --- a/utils/enable-god-mode.ps1 +++ b/utils/enable-god-mode.ps1 @@ -1,19 +1,19 @@ -# Description: -# This scripts places the "God Mode" folder on the current user's desktop. - -echo @" -############################################################################### -# _______ _______ ______ __ __ _______ ______ _______ # -# | || || | | |_| || || | | | # -# | ___|| _ || _ | | || _ || _ || ___| # -# | | __ | | | || | | | | || | | || | | || |___ # -# | || || |_| || |_| | | || |_| || |_| || ___| # -# | |_| || || | | ||_|| || || || |___ # -# |_______||_______||______| |_| |_||_______||______| |_______| # -# # -# God Mode has been enabled, check out the new link on your Desktop # -# # -############################################################################### -"@ -$DesktopPath = [Environment]::GetFolderPath("Desktop"); -mkdir "$DesktopPath\GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}" +# Description: +# This scripts places the "God Mode" folder on the current user's desktop. + +echo @" +############################################################################### +# _______ _______ ______ __ __ _______ ______ _______ # +# | || || | | |_| || || | | | # +# | ___|| _ || _ | | || _ || _ || ___| # +# | | __ | | | || | | | | || | | || | | || |___ # +# | || || |_| || |_| | | || |_| || |_| || ___| # +# | |_| || || | | ||_|| || || || |___ # +# |_______||_______||______| |_| |_||_______||______| |_______| # +# # +# God Mode has been enabled, check out the new link on your Desktop # +# # +############################################################################### +"@ +$DesktopPath = [Environment]::GetFolderPath("Desktop"); +mkdir "$DesktopPath\GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}" From 2c1caa343ec02eb82d6eb24c5f5eaa6e06c8baab Mon Sep 17 00:00:00 2001 From: Gabriel D'Ambrosio Date: Sun, 7 May 2017 20:29:40 -0300 Subject: [PATCH 23/35] Update block-telemetry.ps1 Added new address telemetry ip. --- scripts/block-telemetry.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/block-telemetry.ps1 b/scripts/block-telemetry.ps1 index ed4a517..2fdbcc7 100644 --- a/scripts/block-telemetry.ps1 +++ b/scripts/block-telemetry.ps1 @@ -122,6 +122,7 @@ $domains = @( "vortex.data.microsoft.com" "vortex-sandbox.data.microsoft.com" "vortex-win.data.microsoft.com" + "cy2.vortex.data.microsoft.com.akadns.net" "watson.live.com" "watson.microsoft.com" "watson.ppe.telemetry.microsoft.com" @@ -170,6 +171,7 @@ $ips = @( "65.39.117.230" "65.52.108.33" "65.55.108.23" + "64.4.54.254" ) Remove-NetFirewallRule -DisplayName "Block Telemetry IPs" -ErrorAction SilentlyContinue New-NetFirewallRule -DisplayName "Block Telemetry IPs" -Direction Outbound ` From 9ed991fc61fbe55b10664c55c5288da985a49304 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Mon, 15 May 2017 10:45:17 +0200 Subject: [PATCH 24/35] Mark domains causing issues with Skype ref #79 --- scripts/block-telemetry.ps1 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/block-telemetry.ps1 b/scripts/block-telemetry.ps1 index 2fdbcc7..7c46366 100644 --- a/scripts/block-telemetry.ps1 +++ b/scripts/block-telemetry.ps1 @@ -1,6 +1,12 @@ # Description: # This script blocks telemetry related domains via the hosts file and related # IPs via Windows Firewall. +# +# Please note that adding these domains may break certain software like iTunes +# or Skype. As this issue is location dependent for some domains, they are not +# commented by default. The domains known to cause issues marked accordingly. +# Please see the related issue: +# Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 @@ -53,7 +59,7 @@ $domains = @( "cds26.ams9.msecn.net" "choice.microsoft.com" "choice.microsoft.com.nsatc.net" - "c.msn.com" + "c.msn.com" # can cause issues with Skype "compatexchange.cloudapp.net" "corpext.msitadfs.glbdns2.microsoft.com" "corp.sts.microsoft.com" @@ -145,11 +151,11 @@ $domains = @( "watson.telemetry.microsoft.com", "watson.telemetry.microsoft.com.nsatc.net" "wes.df.telemetry.microsoft.com" - "ui.skype.com", - "pricelist.skype.com" - "apps.skype.com" + "ui.skype.com", # can cause issues with Skype + "pricelist.skype.com" # can cause issues with Skype + "apps.skype.com" # can cause issues with Skype "m.hotmail.com" - "s.gateway.messenger.live.com" + "s.gateway.messenger.live.com" # can cause issues with Skype ) echo "" | Out-File -Encoding ASCII -Append $hosts_file foreach ($domain in $domains) { From 8c2acd11d23ebab323d2b6af3eba8e81745a3235 Mon Sep 17 00:00:00 2001 From: Nacim Goura Date: Wed, 12 Jul 2017 19:18:53 +0200 Subject: [PATCH 25/35] Update remove-default-apps.ps1 remove preinstalled app with creator update --- scripts/remove-default-apps.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index b058d5d..e3479c6 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -76,6 +76,9 @@ $apps = @( "Facebook.Facebook" "flaregamesGmbH.RoyalRevolt2" "Playtika.CaesarsSlotsFreeCasino" + "A278AB0D.MarchofEmpires" + "KeeperSecurityInc.Keeper" + "ThumbmunkeysLtd.PhototasticCollage" # apps which cannot be removed using Remove-AppxPackage #"Microsoft.BioEnrollment" From 88824a1d1af6ce304346d4e8e98134f0e295da3b Mon Sep 17 00:00:00 2001 From: Paulo Henrique Palmeira Franco Date: Wed, 9 Aug 2017 14:25:22 -0300 Subject: [PATCH 26/35] disable memory-compression Windows 10 came with this new feature, but in some cases this may causes some crashes and slowdown the OS. --- utils/disable-memory-compression | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 utils/disable-memory-compression diff --git a/utils/disable-memory-compression b/utils/disable-memory-compression new file mode 100644 index 0000000..9f6c367 --- /dev/null +++ b/utils/disable-memory-compression @@ -0,0 +1,3 @@ +@echo off + +Disable-MMAgent -mc From 44d63869a5b1b1aaa1f4b4bbee1abf64803e2fac Mon Sep 17 00:00:00 2001 From: Mabana2go Date: Mon, 28 Aug 2017 11:08:24 +0200 Subject: [PATCH 27/35] Added Xing and Autodesk SketchBook --- scripts/remove-default-apps.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index e3479c6..a2861ec 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -79,6 +79,8 @@ $apps = @( "A278AB0D.MarchofEmpires" "KeeperSecurityInc.Keeper" "ThumbmunkeysLtd.PhototasticCollage" + "XINGAG.XING" + "89006A2E.AutodeskSketchBook" # apps which cannot be removed using Remove-AppxPackage #"Microsoft.BioEnrollment" From 5b453ddad05d3e94cd73e34122534f6607605de6 Mon Sep 17 00:00:00 2001 From: Mabana2go Date: Fri, 8 Sep 2017 16:50:33 +0200 Subject: [PATCH 28/35] Update remove-default-apps.ps1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As suggested by Rüdiger Hahn I'm adding some additional Apps to the list --- scripts/remove-default-apps.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index a2861ec..cf2e550 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -39,7 +39,9 @@ $apps = @( "Microsoft.ZuneVideo" "microsoft.windowscommunicationsapps" "Microsoft.MinecraftUWP" - + "Microsoft.MicrosoftPowerBIForWindows" + "Microsoft.NetworkSpeedTest" + # Threshold 2 apps "Microsoft.CommsPhone" "Microsoft.ConnectivityStore" @@ -81,6 +83,10 @@ $apps = @( "ThumbmunkeysLtd.PhototasticCollage" "XINGAG.XING" "89006A2E.AutodeskSketchBook" + "D5EA27B7.Duolingo-LearnLanguagesforFree" + "46928bounde.EclipseManager" + "ActiproSoftwareLLC.562882FEEB491" # next one is for the Code Writer from Actipro Software LLC + # apps which cannot be removed using Remove-AppxPackage #"Microsoft.BioEnrollment" From 694cd4f7f66f3cd8a7e7e463c536475aa119ce31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B8rch?= Date: Fri, 15 Sep 2017 18:24:09 +0200 Subject: [PATCH 29/35] Remove OneDrive scheduled task After running 'remove-onedrive.ps1' recently, I noticed a left over OneDrive scheduled task on my system. This should silently remove it, if it's present or not. --- scripts/remove-onedrive.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/remove-onedrive.ps1 b/scripts/remove-onedrive.ps1 index 49ecd41..951539a 100644 --- a/scripts/remove-onedrive.ps1 +++ b/scripts/remove-onedrive.ps1 @@ -42,6 +42,9 @@ reg unload "hku\Default" echo "Removing startmenu entry" rm -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" +echo "Removing scheduled task" +Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false + echo "Restarting explorer" start "explorer.exe" From 25a2b583962ed3a666bbff379f0541fe47f8cdd5 Mon Sep 17 00:00:00 2001 From: Michael McCormick Date: Sun, 1 Oct 2017 17:41:59 -0500 Subject: [PATCH 30/35] Replaced aliases with full cmdlet names, per PSScriptAnalyzer --- scripts/block-telemetry.ps1 | 12 ++-- scripts/disable-services.ps1 | 2 +- scripts/disable-windows-defender.ps1 | 38 +++++------ scripts/experimental_unfuckery.ps1 | 10 +-- scripts/fix-privacy-settings.ps1 | 90 +++++++++++++------------- scripts/optimize-user-interface.ps1 | 96 ++++++++++++++-------------- scripts/optimize-windows-update.ps1 | 16 ++--- scripts/remove-default-apps.ps1 | 10 +-- scripts/remove-onedrive.ps1 | 44 ++++++------- utils/enable-god-mode.ps1 | 2 +- 10 files changed, 160 insertions(+), 160 deletions(-) diff --git a/scripts/block-telemetry.ps1 b/scripts/block-telemetry.ps1 index 7c46366..6222b34 100644 --- a/scripts/block-telemetry.ps1 +++ b/scripts/block-telemetry.ps1 @@ -10,11 +10,11 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 -echo "Disabling telemetry via Group Policies" +Write-Output "Disabling telemetry via Group Policies" force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0 +Set-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0 -echo "Adding telemetry domains to hosts file" +Write-Output "Adding telemetry domains to hosts file" $hosts_file = "$env:systemroot\System32\drivers\etc\hosts" $domains = @( "184-86-53-99.deploy.static.akamaitechnologies.com" @@ -157,14 +157,14 @@ $domains = @( "m.hotmail.com" "s.gateway.messenger.live.com" # can cause issues with Skype ) -echo "" | Out-File -Encoding ASCII -Append $hosts_file +Write-Output "" | Out-File -Encoding ASCII -Append $hosts_file foreach ($domain in $domains) { if (-Not (Select-String -Path $hosts_file -Pattern $domain)) { - echo "0.0.0.0 $domain" | Out-File -Encoding ASCII -Append $hosts_file + Write-Output "0.0.0.0 $domain" | Out-File -Encoding ASCII -Append $hosts_file } } -echo "Adding telemetry ips to firewall" +Write-Output "Adding telemetry ips to firewall" $ips = @( "134.170.30.202" "137.116.81.24" diff --git a/scripts/disable-services.ps1 b/scripts/disable-services.ps1 index 8aee7c5..b25edb1 100644 --- a/scripts/disable-services.ps1 +++ b/scripts/disable-services.ps1 @@ -29,6 +29,6 @@ $services = @( ) foreach ($service in $services) { - echo "Trying to disable $service" + Write-Output "Trying to disable $service" Get-Service -Name $service | Set-Service -StartupType Disabled } diff --git a/scripts/disable-windows-defender.ps1 b/scripts/disable-windows-defender.ps1 index b1cd43e..48a18dd 100644 --- a/scripts/disable-windows-defender.ps1 +++ b/scripts/disable-windows-defender.ps1 @@ -6,7 +6,7 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 -echo "Elevating priviledges for this process" +Write-Output "Elevating priviledges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) $tasks = @( @@ -21,28 +21,28 @@ foreach ($task in $tasks) { $name = $parts[-1] $path = $parts[0..($parts.length-2)] -join '\' - echo "Trying to disable scheduled task $name" + Write-Output "Trying to disable scheduled task $name" Disable-ScheduledTask -TaskName "$name" -TaskPath "$path" } -echo "Disabling Windows Defender via Group Policies" +Write-Output "Disabling Windows Defender via Group Policies" force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender" -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender" "DisableAntiSpyware" 1 -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender" "DisableRoutinelyTakingAction" 1 +Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender" "DisableAntiSpyware" 1 +Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender" "DisableRoutinelyTakingAction" 1 force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender\Real-Time Protection" -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender\Real-Time Protection" "DisableRealtimeMonitoring" 1 +Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows Defender\Real-Time Protection" "DisableRealtimeMonitoring" 1 -echo "Disabling Windows Defender Services" +Write-Output "Disabling Windows Defender Services" Takeown-Registry("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend") -sp "HKLM:\SYSTEM\CurrentControlSet\Services\WinDefend" "Start" 4 -sp "HKLM:\SYSTEM\CurrentControlSet\Services\WinDefend" "AutorunsDisabled" 3 -sp "HKLM:\SYSTEM\CurrentControlSet\Services\WdNisSvc" "Start" 4 -sp "HKLM:\SYSTEM\CurrentControlSet\Services\WdNisSvc" "AutorunsDisabled" 3 -sp "HKLM:\SYSTEM\CurrentControlSet\Services\Sense" "Start" 4 -sp "HKLM:\SYSTEM\CurrentControlSet\Services\Sense" "AutorunsDisabled" 3 - -echo "Removing Windows Defender context menu item" -si "HKLM:\SOFTWARE\Classes\CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32" "" - -echo "Removing Windows Defender GUI / tray from autorun" -rp "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "WindowsDefender" -ea 0 +Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\WinDefend" "Start" 4 +Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\WinDefend" "AutorunsDisabled" 3 +Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\WdNisSvc" "Start" 4 +Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\WdNisSvc" "AutorunsDisabled" 3 +Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Sense" "Start" 4 +Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Sense" "AutorunsDisabled" 3 + +Write-Output "Removing Windows Defender context menu item" +Set-Item "HKLM:\SOFTWARE\Classes\CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32" "" + +Write-Output "Removing Windows Defender GUI / tray from autorun" +Remove-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "WindowsDefender" -ea 0 diff --git a/scripts/experimental_unfuckery.ps1 b/scripts/experimental_unfuckery.ps1 index 3761fc4..4bcd7e4 100644 --- a/scripts/experimental_unfuckery.ps1 +++ b/scripts/experimental_unfuckery.ps1 @@ -5,10 +5,10 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 -echo "Elevating priviledges for this process" +Write-Output "Elevating priviledges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) -echo "Force removing system apps" +Write-Output "Force removing system apps" $needles = @( #"Anytime" "BioEnrollment" @@ -27,10 +27,10 @@ $needles = @( ) foreach ($needle in $needles) { - echo "Trying to remove all packages containing $needle" + Write-Output "Trying to remove all packages containing $needle" - $pkgs = (ls "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" | - where Name -Like "*$needle*") + $pkgs = (Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" | + Where-Object Name -Like "*$needle*") foreach ($pkg in $pkgs) { $pkgname = $pkg.Name.split('\')[-1] diff --git a/scripts/fix-privacy-settings.ps1 b/scripts/fix-privacy-settings.ps1 index 3d51dae..23f00f3 100644 --- a/scripts/fix-privacy-settings.ps1 +++ b/scripts/fix-privacy-settings.ps1 @@ -5,26 +5,26 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 -echo "Elevating priviledges for this process" +Write-Output "Elevating priviledges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) -echo "Defuse Windows search settings" +Write-Output "Defuse Windows search settings" Set-WindowsSearchSetting -EnableWebResultsSetting $false -echo "Set general privacy options" -sp "HKCU:\Control Panel\International\User Profile" "HttpAcceptLanguageOptOut" 1 +Write-Output "Set general privacy options" +Set-ItemProperty "HKCU:\Control Panel\International\User Profile" "HttpAcceptLanguageOptOut" 1 force-mkdir "HKCU:\Printers\Defaults" -sp "HKCU:\Printers\Defaults" "NetID" "{00000000-0000-0000-0000-000000000000}" +Set-ItemProperty "HKCU:\Printers\Defaults" "NetID" "{00000000-0000-0000-0000-000000000000}" force-mkdir "HKCU:\SOFTWARE\Microsoft\Input\TIPC" -sp "HKCU:\SOFTWARE\Microsoft\Input\TIPC" "Enabled" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Input\TIPC" "Enabled" 0 force-mkdir "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" 0 -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" "EnableWebContentEvaluation" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" "EnableWebContentEvaluation" 0 -echo "Disable synchronisation of settings" -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync" "BackupPolicy" 0x3c -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync" "DeviceMetadataUploaded" 0 -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync" "PriorLogons" 1 +Write-Output "Disable synchronisation of settings" +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync" "BackupPolicy" 0x3c +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync" "DeviceMetadataUploaded" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync" "PriorLogons" 1 $groups = @( "Accessibility" "AppSync" @@ -39,63 +39,63 @@ $groups = @( ) foreach ($group in $groups) { force-mkdir "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync\Groups\$group" - sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync\Groups\$group" "Enabled" 0 + Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync\Groups\$group" "Enabled" 0 } -echo "Set privacy policy accepted state to 0" +Write-Output "Set privacy policy accepted state to 0" force-mkdir "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -sp "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" "AcceptedPrivacyPolicy" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" "AcceptedPrivacyPolicy" 0 -echo "Do not scan contact informations" +Write-Output "Do not scan contact informations" force-mkdir "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -sp "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" "HarvestContacts" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" "HarvestContacts" 0 -echo "Inking and typing settings" +Write-Output "Inking and typing settings" force-mkdir "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -sp "HKCU:\SOFTWARE\Microsoft\InputPersonalization" "RestrictImplicitInkCollection" 1 -sp "HKCU:\SOFTWARE\Microsoft\InputPersonalization" "RestrictImplicitTextCollection" 1 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\InputPersonalization" "RestrictImplicitInkCollection" 1 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\InputPersonalization" "RestrictImplicitTextCollection" 1 -echo "Microsoft Edge settings" +Write-Output "Microsoft Edge settings" force-mkdir "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Main" -sp "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Main" "DoNotTrack" 1 +Set-ItemProperty "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Main" "DoNotTrack" 1 force-mkdir "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\User\Default\SearchScopes" -sp "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\User\Default\SearchScopes" "ShowSearchSuggestionsGlobal" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\User\Default\SearchScopes" "ShowSearchSuggestionsGlobal" 0 force-mkdir "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\FlipAhead" -sp "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\FlipAhead" "FPEnabled" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\FlipAhead" "FPEnabled" 0 force-mkdir "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\PhishingFilter" -sp "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\PhishingFilter" "EnabledV9" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\PhishingFilter" "EnabledV9" 0 -echo "Disable background access of default apps" -foreach ($key in (ls "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications")) { - sp ("HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\" + $key.PSChildName) "Disabled" 1 +Write-Output "Disable background access of default apps" +foreach ($key in (Get-ChildItem "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications")) { + Set-ItemProperty ("HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\" + $key.PSChildName) "Disabled" 1 } -echo "Denying device access" -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\LooselyCoupled" "Type" "LooselyCoupled" -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\LooselyCoupled" "Value" "Deny" -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\LooselyCoupled" "InitialAppValue" "Unspecified" -foreach ($key in (ls "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global")) { +Write-Output "Denying device access" +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\LooselyCoupled" "Type" "LooselyCoupled" +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\LooselyCoupled" "Value" "Deny" +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\LooselyCoupled" "InitialAppValue" "Unspecified" +foreach ($key in (Get-ChildItem "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global")) { if ($key.PSChildName -EQ "LooselyCoupled") { continue } - sp ("HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\" + $key.PSChildName) "Type" "InterfaceClass" - sp ("HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\" + $key.PSChildName) "Value" "Deny" - sp ("HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\" + $key.PSChildName) "InitialAppValue" "Unspecified" + Set-ItemProperty ("HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\" + $key.PSChildName) "Type" "InterfaceClass" + Set-ItemProperty ("HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\" + $key.PSChildName) "Value" "Deny" + Set-ItemProperty ("HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\" + $key.PSChildName) "InitialAppValue" "Unspecified" } -echo "Disable location sensor" +Write-Output "Disable location sensor" force-mkdir "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Permissions\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -sp "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Permissions\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" "SensorPermissionState" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Permissions\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" "SensorPermissionState" 0 -echo "Disable submission of Windows Defender findings (w/ elevated privileges)" +Write-Output "Disable submission of Windows Defender findings (w/ elevated privileges)" Takeown-Registry("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Spynet") -sp "HKLM:\SOFTWARE\Microsoft\Windows Defender\Spynet" "SpyNetReporting" 0 # write-protected even after takeown ?! -sp "HKLM:\SOFTWARE\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" 0 +Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows Defender\Spynet" "SpyNetReporting" 0 # write-protected even after takeown ?! +Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" 0 -echo "Do not share wifi networks" +Write-Output "Do not share wifi networks" $user = New-Object System.Security.Principal.NTAccount($env:UserName) $sid = $user.Translate([System.Security.Principal.SecurityIdentifier]).value force-mkdir ("HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features\" + $sid) -sp ("HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features\" + $sid) "FeatureStates" 0x33c -sp "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseCredShared" 0 -sp "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseOpen" 0 +Set-ItemProperty ("HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features\" + $sid) "FeatureStates" 0x33c +Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseCredShared" 0 +Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" "WiFiSenseOpen" 0 diff --git a/scripts/optimize-user-interface.ps1 b/scripts/optimize-user-interface.ps1 index c7d8b67..d5b9b5c 100644 --- a/scripts/optimize-user-interface.ps1 +++ b/scripts/optimize-user-interface.ps1 @@ -6,78 +6,78 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 -echo "Elevating priviledges for this process" +Write-Output "Elevating priviledges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) -echo "Apply MarkC's mouse acceleration fix" -sp "HKCU:\Control Panel\Mouse" "MouseSensitivity" "10" -sp "HKCU:\Control Panel\Mouse" "MouseSpeed" "0" -sp "HKCU:\Control Panel\Mouse" "MouseThreshold1" "0" -sp "HKCU:\Control Panel\Mouse" "MouseThreshold2" "0" -sp "HKCU:\Control Panel\Mouse" "SmoothMouseXCurve" ([byte[]](0x00, 0x00, 0x00, +Write-Output "Apply MarkC's mouse acceleration fix" +Set-ItemProperty "HKCU:\Control Panel\Mouse" "MouseSensitivity" "10" +Set-ItemProperty "HKCU:\Control Panel\Mouse" "MouseSpeed" "0" +Set-ItemProperty "HKCU:\Control Panel\Mouse" "MouseThreshold1" "0" +Set-ItemProperty "HKCU:\Control Panel\Mouse" "MouseThreshold2" "0" +Set-ItemProperty "HKCU:\Control Panel\Mouse" "SmoothMouseXCurve" ([byte[]](0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xCC, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x99, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x66, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00)) -sp "HKCU:\Control Panel\Mouse" "SmoothMouseYCurve" ([byte[]](0x00, 0x00, 0x00, +Set-ItemProperty "HKCU:\Control Panel\Mouse" "SmoothMouseYCurve" ([byte[]](0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00)) -echo "Disable mouse pointer hiding" -sp "HKCU:\Control Panel\Desktop" "UserPreferencesMask" ([byte[]](0x9e, +Write-Output "Disable mouse pointer hiding" +Set-ItemProperty "HKCU:\Control Panel\Desktop" "UserPreferencesMask" ([byte[]](0x9e, 0x1e, 0x06, 0x80, 0x12, 0x00, 0x00, 0x00)) -echo "Disable Game DVR and Game Bar" +Write-Output "Disable Game DVR and Game Bar" force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" "AllowgameDVR" 0 +Set-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" "AllowgameDVR" 0 -echo "Disable easy access keyboard stuff" -sp "HKCU:\Control Panel\Accessibility\StickyKeys" "Flags" "506" -sp "HKCU:\Control Panel\Accessibility\Keyboard Response" "Flags" "122" -sp "HKCU:\Control Panel\Accessibility\ToggleKeys" "Flags" "58" +Write-Output "Disable easy access keyboard stuff" +Set-ItemProperty "HKCU:\Control Panel\Accessibility\StickyKeys" "Flags" "506" +Set-ItemProperty "HKCU:\Control Panel\Accessibility\Keyboard Response" "Flags" "122" +Set-ItemProperty "HKCU:\Control Panel\Accessibility\ToggleKeys" "Flags" "58" -echo "Restoring old volume slider" +Write-Output "Restoring old volume slider" force-mkdir "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\MTCUVC" -sp "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\MTCUVC" "EnableMtcUvc" 0 +Set-ItemProperty "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\MTCUVC" "EnableMtcUvc" 0 -echo "Setting folder view options" -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Hidden" 1 -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideFileExt" 0 -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideDrivesWithNoMedia" 0 -sp "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ShowSyncProviderNotifications" 0 +Write-Output "Setting folder view options" +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Hidden" 1 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideFileExt" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideDrivesWithNoMedia" 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ShowSyncProviderNotifications" 0 -echo "Setting default explorer view to This PC" -sp "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "LaunchTo" 1 +Write-Output "Setting default explorer view to This PC" +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "LaunchTo" 1 -echo "Removing user folders under This PC" +Write-Output "Removing user folders under This PC" # Remove Desktop from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" # Remove Documents from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" # Remove Downloads from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" # Remove Music from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" # Remove Pictures from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" # Remove Videos from This PC -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -rm "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -rm "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" #echo "Disabling tile push notification" #force-mkdir "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" diff --git a/scripts/optimize-windows-update.ps1 b/scripts/optimize-windows-update.ps1 index 3835e93..434125a 100644 --- a/scripts/optimize-windows-update.ps1 +++ b/scripts/optimize-windows-update.ps1 @@ -4,21 +4,21 @@ # Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 -echo "Disable automatic download and installation of Windows updates" +Write-Output "Disable automatic download and installation of Windows updates" force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "NoAutoUpdate" 0 -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "AUOptions" 2 -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "ScheduledInstallDay" 0 -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "ScheduledInstallTime" 3 +Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "NoAutoUpdate" 0 +Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "AUOptions" 2 +Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "ScheduledInstallDay" 0 +Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "ScheduledInstallTime" 3 -echo "Disable seeding of updates to other computers via Group Policies" +Write-Output "Disable seeding of updates to other computers via Group Policies" force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" -sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" "DODownloadMode" 0 +Set-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" "DODownloadMode" 0 #echo "Disabling automatic driver update" #sp "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" "SearchOrderConfig" 0 -echo "Disable 'Updates are available' message" +Write-Output "Disable 'Updates are available' message" takeown /F "$env:WinDIR\System32\MusNotification.exe" icacls "$env:WinDIR\System32\MusNotification.exe" /deny "Everyone:(X)" takeown /F "$env:WinDIR\System32\MusNotificationUx.exe" diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index cf2e550..e8750ed 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -5,10 +5,10 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 -echo "Elevating privileges for this process" +Write-Output "Elevating privileges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) -echo "Uninstalling default apps" +Write-Output "Uninstalling default apps" $apps = @( # default Windows 10 apps "Microsoft.3DBuilder" @@ -99,15 +99,15 @@ $apps = @( ) foreach ($app in $apps) { - echo "Trying to remove $app" + Write-Output "Trying to remove $app" Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage Get-AppXProvisionedPackage -Online | - where DisplayName -EQ $app | + Where-Object DisplayName -EQ $app | Remove-AppxProvisionedPackage -Online } # Prevents "Suggested Applications" returning force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" -sp "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" "DisableWindowsConsumerFeatures" 1 +Set-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" "DisableWindowsConsumerFeatures" 1 diff --git a/scripts/remove-onedrive.ps1 b/scripts/remove-onedrive.ps1 index 951539a..5b2e047 100644 --- a/scripts/remove-onedrive.ps1 +++ b/scripts/remove-onedrive.ps1 @@ -4,11 +4,11 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 -echo "Kill OneDrive process" +Write-Output "Kill OneDrive process" taskkill.exe /F /IM "OneDrive.exe" taskkill.exe /F /IM "explorer.exe" -echo "Remove OneDrive" +Write-Output "Remove OneDrive" if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") { & "$env:systemroot\System32\OneDriveSetup.exe" /uninstall } @@ -16,43 +16,43 @@ if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") { & "$env:systemroot\SysWOW64\OneDriveSetup.exe" /uninstall } -echo "Removing OneDrive leftovers" -rm -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" -rm -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" -rm -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp" +Write-Output "Removing OneDrive leftovers" +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp" -echo "Disable OneDrive via Group Policies" +Write-Output "Disable OneDrive via Group Policies" force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" -sp "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1 +Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1 -echo "Remove Onedrive from explorer sidebar" +Write-Output "Remove Onedrive from explorer sidebar" New-PSDrive -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" -Name "HKCR" mkdir -Force "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -sp "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 +Set-ItemProperty "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 mkdir -Force "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -sp "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 +Set-ItemProperty "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 Remove-PSDrive "HKCR" # Thank you Matthew Israelsson -echo "Removing run hook for new users" +Write-Output "Removing run hook for new users" reg load "hku\Default" "C:\Users\Default\NTUSER.DAT" reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f reg unload "hku\Default" -echo "Removing startmenu entry" -rm -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" +Write-Output "Removing startmenu entry" +Remove-Item -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" -echo "Removing scheduled task" +Write-Output "Removing scheduled task" Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false -echo "Restarting explorer" -start "explorer.exe" +Write-Output "Restarting explorer" +Start-Process "explorer.exe" -echo "Waiting for explorer to complete loading" -sleep 10 +Write-Output "Waiting for explorer to complete loading" +Start-Sleep 10 -echo "Removing additional OneDrive leftovers" -foreach ($item in (ls "$env:WinDir\WinSxS\*onedrive*")) { +Write-Output "Removing additional OneDrive leftovers" +foreach ($item in (Get-ChildItem "$env:WinDir\WinSxS\*onedrive*")) { Takeown-Folder $item.FullName - rm -Recurse -Force $item.FullName + Remove-Item -Recurse -Force $item.FullName } diff --git a/utils/enable-god-mode.ps1 b/utils/enable-god-mode.ps1 index 4e5a2ac..a26a8b1 100644 --- a/utils/enable-god-mode.ps1 +++ b/utils/enable-god-mode.ps1 @@ -1,7 +1,7 @@ # Description: # This scripts places the "God Mode" folder on the current user's desktop. -echo @" +Write-Output @" ############################################################################### # _______ _______ ______ __ __ _______ ______ _______ # # | || || | | |_| || || | | | # From 4a10fc434e75937c4e2794d1ed18518917856598 Mon Sep 17 00:00:00 2001 From: mmikeww Date: Tue, 24 Oct 2017 00:04:43 -0400 Subject: [PATCH 31/35] remove apps for AllUsers As of v1709 (Fall Creator's Update), there is a new "-AllUsers" flag for Remove-AppxPackage https://social.technet.microsoft.com/Forums/en-US/1d096aa8-924b-484a-ae92-7757e3029198/powershell-script-to-remove-apps-doesnt-work-for-all-users?forum=win10itprosetup --- scripts/remove-default-apps.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index e8750ed..caafaa8 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -101,7 +101,7 @@ $apps = @( foreach ($app in $apps) { Write-Output "Trying to remove $app" - Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage + Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers Get-AppXProvisionedPackage -Online | Where-Object DisplayName -EQ $app | From 8f3fb939d66a80938e77628c040e20deb13d053f Mon Sep 17 00:00:00 2001 From: mmikeww Date: Wed, 25 Oct 2017 18:49:34 -0400 Subject: [PATCH 32/35] remove extra onedrive directory (#133) * remove extra onedrive directory * check if onedrive folder is empty before deleting --- scripts/remove-onedrive.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/remove-onedrive.ps1 b/scripts/remove-onedrive.ps1 index 5b2e047..4d3fb19 100644 --- a/scripts/remove-onedrive.ps1 +++ b/scripts/remove-onedrive.ps1 @@ -19,7 +19,11 @@ if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") { Write-Output "Removing OneDrive leftovers" Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" -Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp" +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp" +# check if directory is empty before removing: +If ((Get-ChildItem "$env:userprofile\OneDrive" -Recurse | Measure-Object).Count -eq 0) { + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" +} Write-Output "Disable OneDrive via Group Policies" force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" From 316ae7bbef7e27e60921b2097e815a8f3956e144 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Mon, 30 Oct 2017 10:04:11 +0100 Subject: [PATCH 33/35] Add Removal of new "3D Objects" folder from This PC --- scripts/optimize-user-interface.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/optimize-user-interface.ps1 b/scripts/optimize-user-interface.ps1 index d5b9b5c..b723b0a 100644 --- a/scripts/optimize-user-interface.ps1 +++ b/scripts/optimize-user-interface.ps1 @@ -78,6 +78,9 @@ Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" +# Remove 3D Objects from This PC +Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" +Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" #echo "Disabling tile push notification" #force-mkdir "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" From e8670d9a98272372a10d6e98e4b8420ccb677cf3 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Tue, 31 Oct 2017 10:51:21 +0100 Subject: [PATCH 34/35] Ignore errors when disabling scheduled tasks close #135 --- utils/disable-scheduled-tasks.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/disable-scheduled-tasks.ps1 b/utils/disable-scheduled-tasks.ps1 index 30d599b..3462f7e 100644 --- a/utils/disable-scheduled-tasks.ps1 +++ b/utils/disable-scheduled-tasks.ps1 @@ -203,5 +203,5 @@ foreach ($task in $tasks) { $name = $parts[-1] $path = $parts[0..($parts.length-2)] -join '\' - Disable-ScheduledTask -TaskName "$name" -TaskPath "$path" + Disable-ScheduledTask -TaskName "$name" -TaskPath "$path" -ErrorAction SilentlyContinue } From fce233d7291a9c12f642f7f4219b8927c89e2169 Mon Sep 17 00:00:00 2001 From: Mabana2go Date: Tue, 19 Dec 2017 13:44:52 +0100 Subject: [PATCH 35/35] Update remove-default-apps.ps1 (#139) * Update remove-default-apps.ps1 * Update remove-default-apps.ps1 --- scripts/remove-default-apps.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index caafaa8..f0602d3 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -86,6 +86,10 @@ $apps = @( "D5EA27B7.Duolingo-LearnLanguagesforFree" "46928bounde.EclipseManager" "ActiproSoftwareLLC.562882FEEB491" # next one is for the Code Writer from Actipro Software LLC + "DolbyLaboratories.DolbyAccess" + "SpotifyAB.SpotifyMusic" + "A278AB0D.DisneyMagicKingdoms" + "WinZipComputing.WinZipUniversal" # apps which cannot be removed using Remove-AppxPackage