Reworked for Infotech-IT
This commit is contained in:
parent
74599adea2
commit
906633df2b
210
Win11.ps1
210
Win11.ps1
@ -1,24 +1,108 @@
|
|||||||
$ErrorActionPreference = 'SilentlyContinue'
|
$ErrorActionPreference = 'SilentlyContinue'
|
||||||
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
|
|
||||||
#
|
# Function to check for administrative privileges:
|
||||||
Read-Host -Prompt "The script needs Administrator privileges! [ENTER to confirm.]"
|
function Test-IsAdmin {
|
||||||
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`" $PSCommandArgs" -Verb RunAs
|
$currentUser = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
|
||||||
Exit
|
return $currentUser.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Elevate script if not running as administrator:
|
||||||
|
if (-not (Test-IsAdmin)) {
|
||||||
|
Read-Host -Prompt "The script needs Administrator privileges! [ENTER to confirm.]"
|
||||||
|
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
|
||||||
|
Exit
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to get the SID of a user:
|
||||||
|
function Get-UserSID {
|
||||||
|
param (
|
||||||
|
[string]$Username
|
||||||
|
)
|
||||||
|
$objUser = New-Object System.Security.Principal.NTAccount($Username)
|
||||||
|
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier]).Value
|
||||||
|
return $strSID
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to apply registry settings for a given user SID:
|
||||||
|
function Set-HKCUSettings {
|
||||||
|
param (
|
||||||
|
[string]$UserSID
|
||||||
|
)
|
||||||
|
$userHive = "Registry::HKEY_USERS\$UserSID"
|
||||||
|
Write-Output "Applying settings for user SID: $UserSID"
|
||||||
|
|
||||||
|
# Apply registry settings per user:
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Policies\Microsoft\Windows\WindowsAI" -Name "DisableAIDataAnalysis" -Type DWord -Value 1
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Policies\Microsoft\Windows\WindowsCopilot" -Name "TurnOffWindowsCopilot" -Type DWord -Value 1
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338393Enabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353694Enabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353696Enabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Input\TIPC" -Name "Enabled" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Control Panel\International\User Profile" -Name "HttpAcceptLanguageOptOut" -Type DWord -Value 1
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAl" -Type Dword -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type Dword -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarMn" -Type Dword -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarDa" -Type Dword -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Type Dword -Name "SystemUsesLightTheme" -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Type Dword -Name "AppsUseLightTheme" -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Themes" -Type String -Name "CurrentTheme" -Value "C:\Windows\resources\Themes\dark.theme"
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Themes" -Type MultiString -Name "ThemeMRU" -Value "C:\Windows\resources\Themes\dark.theme;C:\Windows\resources\Themes\aero.theme;"
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Siuf\Rules" -Name "PeriodInNanoSeconds" -Type QWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Start_TrackProgs" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 1
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsSpotlightFeatures" -Type DWord -Value 1
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Policies\Microsoft\Windows\CloudContent" -Name "DisableThirdPartySuggestions" -Type DWord -Value 1
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableThumbsDBOnNetworkFolders" -Type DWord -Value 1
|
||||||
|
#reg add "$userHive\Software\Policies\Microsoft\Windows\Explorer" /v DisableThumbsDBOnNetworkFolders /d 0x1 /t REG_DWORD /f
|
||||||
|
# Restore Windows 10 context menu:
|
||||||
|
If (!(Test-Path "$userHive\Software\CLASSES\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}")) {
|
||||||
|
New-Item -Path "$userHive\Software\CLASSES\CLSID" -Name "{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}"
|
||||||
|
New-Item -Path "$userHive\Software\CLASSES\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" -Name "InprocServer32"
|
||||||
|
}
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\CLASSES\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" -Name "(Default)" -Value ""
|
||||||
|
# Default Explorer view 'This PC':
|
||||||
|
Set-ItemProperty -Path "$userHive\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value "1"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Loop through all user profiles
|
||||||
|
$profiles = Get-WmiObject Win32_UserProfile | Where-Object { $_.Special -eq $false -and $_.LocalPath -ne $null }
|
||||||
|
|
||||||
|
foreach ($profile in $profiles) {
|
||||||
|
$username = $profile.LocalPath.Split('\')[-1]
|
||||||
|
try {
|
||||||
|
$userSID = Get-UserSID -Username $username
|
||||||
|
Set-HKCUSettings -UserSID $userSID
|
||||||
|
} catch {
|
||||||
|
#Write-Warning "Error processing user $username:"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Settings applied to all user profiles."
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# Bloatware / Service configuration Array to Remove / to be Disabled
|
# Bloatware / Service configuration Array to Remove / to be Disabled
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
$Bloatware = @(
|
$Bloatware = @(
|
||||||
"*Spotify*", "*CandyCrush*", "*Facebook*", "*Twitter*", "*LinkedInforWindows*",
|
"*Spotify*", "*CandyCrush*", "*Facebook*", "*Twitter*", "*LinkedInforWindows*",
|
||||||
"*Disney*", "*Netflix*", "*BubbleWitch*", "*Duolingo*", "*Minecraft*",
|
"*Disney*", "*Netflix*", "*BubbleWitch*", "*Duolingo*", "*Minecraft*",
|
||||||
|
|
||||||
"Microsoft.WindowsFeedback*", "*Microsoft.Xbox*", "Microsoft.GamingApp*",
|
"Microsoft.WindowsFeedback*", "*Microsoft.Xbox*", "Microsoft.GamingApp*",
|
||||||
"Microsoft.WindowsMaps*",
|
"Microsoft.WindowsMaps*", "Microsoft.WindowsPhone*", "Microsoft.WindowsAlarms*",
|
||||||
"Microsoft.WindowsPhone*", "Microsoft.WindowsAlarms*", "Microsoft.YourPhone*",
|
"Microsoft.YourPhone*", "Microsoft.People*", "Microsoft.Wallet*",
|
||||||
"Microsoft.People*", "Microsoft.Wallet*", "Microsoft.GetHelp",
|
"Microsoft.GetHelp", "Microsoft.Zune*", "Microsoft.SkypeApp*", "*Microsoft.Messaging*",
|
||||||
"Microsoft.Zune*", "Microsoft.SkypeApp*", "*Microsoft.Messaging*",
|
"Microsoft.Advertising.Xaml*", "Microsoft.Bing*", "*windowscommunicationsapps*"
|
||||||
"Microsoft.Advertising.Xaml*", "Microsoft.Bing*", "*windowscommunicationsapps*"
|
|
||||||
)
|
)
|
||||||
$services = @(
|
$services = @(
|
||||||
"diagnosticshub.standardcollector.service", "DiagTrack",
|
"diagnosticshub.standardcollector.service", "DiagTrack",
|
||||||
@ -31,14 +115,14 @@ $services = @(
|
|||||||
# Restore Point
|
# Restore Point
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
Enable-ComputerRestore -Drive "C:\"
|
Enable-ComputerRestore -Drive "C:\"
|
||||||
Checkpoint-Computer -Description "Swissmakers GmbH | pre-usage Win11 hardening-Script" -RestorePointType "MODIFY_SETTINGS"
|
Checkpoint-Computer -Description "Swissmakers GmbH - Pre usage Win11 hardening script" -RestorePointType "MODIFY_SETTINGS"
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# O&O Shutup Integration
|
# O&O Shutup Integration
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
#Start-BitsTransfer "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe"
|
#Start-BitsTransfer "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe"
|
||||||
#Start-BitsTransfer "https://code.michu-it.com/michael/win11-initial-setup-script/raw/branch/master/mrit_ooshutup.cfg"
|
#Start-BitsTransfer "https://code.michu-it.com/michael/win11-initial-setup-script/raw/branch/master/mrit_ooshutup.cfg"
|
||||||
Start-Process -FilePath "./OOSU10.exe" -ArgumentList 'mrit_ooshutup.cfg' -Wait
|
Start-Process -FilePath "./OOSU10.exe" -ArgumentList 'mrit_ooshutup.cfg' -Wait
|
||||||
#Remove-Item -Path ".\OOSU10.exe" -Force
|
#Remove-Item -Path ".\OOSU10.exe" -Force
|
||||||
#Remove-Item -Path ".\mrit_ooshutup.cfg" -Force
|
#Remove-Item -Path ".\mrit_ooshutup.cfg" -Force
|
||||||
|
|
||||||
@ -47,43 +131,13 @@ Start-Process -FilePath "./OOSU10.exe" -ArgumentList 'mrit_ooshutup.cfg' -Wait
|
|||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
Start-Process -FilePath "./ninite.exe" -Wait
|
Start-Process -FilePath "./ninite.exe" -Wait
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# Design
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# Start menu position left:
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAl" -type "Dword" -Value "0"
|
|
||||||
|
|
||||||
# Remove Task View from Taskbar:
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -type "Dword" -Value "0"
|
|
||||||
|
|
||||||
# Remove Chat from Taskbar:
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarMn" -type "Dword" -Value "0"
|
|
||||||
|
|
||||||
# Remove Widgets from Taskbar:
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarDa" -type "Dword" -Value "0"
|
|
||||||
|
|
||||||
# Remove Search from Taskbar:
|
|
||||||
#Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -type "Dword" -Value "0"
|
|
||||||
|
|
||||||
# Enable Windows Explorer Compact View:
|
|
||||||
#Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -type "Dword" -Name "UseCompactMode" -Value "1"
|
|
||||||
|
|
||||||
# Enable Windows Darkmode and default Dark-Blue Theme:
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -type "Dword" -Name "SystemUsesLightTheme" -Value "0"
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -type "Dword" -Name "AppsUseLightTheme" -Value "0"
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes" -type "Dword" -Name "CurrentTheme" -Value "C:\Windows\resources\Themes\dark.theme"
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes" -type "Dword" -Name "ThemeMRU" -Value "C:\Windows\resources\Themes\dark.theme;C:\Windows\resources\Themes\aero.theme;"
|
|
||||||
|
|
||||||
stop-process -name explorer –force
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# Debloat
|
# Debloat
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# Disk Cleanup:
|
# Disk Cleanup:
|
||||||
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\*' | ForEach-Object {
|
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\*' | ForEach-Object {
|
||||||
New-ItemProperty -Path $_.PSPath -Name StateFlags0005 -Value 2 -PropertyType DWord -Force
|
New-ItemProperty -Path $_.PSPath -Name StateFlags0005 -Value 2 -PropertyType DWord -Force
|
||||||
};
|
}
|
||||||
Start-Process -FilePath CleanMgr.exe -ArgumentList '/sagerun:5' -Wait
|
Start-Process -FilePath CleanMgr.exe -ArgumentList '/sagerun:5' -Wait
|
||||||
|
|
||||||
# Remove Temp Files:
|
# Remove Temp Files:
|
||||||
@ -92,10 +146,10 @@ Remove-Item $env:TEMP\* -Recurse -Force -ErrorAction $ErrorActionPreference
|
|||||||
|
|
||||||
# Uninstall Bloatware-Apps:
|
# Uninstall Bloatware-Apps:
|
||||||
foreach ($Bloat in $Bloatware) {
|
foreach ($Bloat in $Bloatware) {
|
||||||
# Uninstall App on all Current User:
|
# Uninstall App on all Current User:
|
||||||
Get-AppxPackage -Name $Bloat -AllUsers | Remove-AppxPackage
|
Get-AppxPackage -Name $Bloat -AllUsers | Remove-AppxPackage
|
||||||
# This will prevent these apps from being reinstalled on new user first logon:
|
# This will prevent these apps from being reinstalled on new user first logon:
|
||||||
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online
|
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online
|
||||||
}
|
}
|
||||||
|
|
||||||
# Disable Services:
|
# Disable Services:
|
||||||
@ -105,13 +159,11 @@ foreach ($service in $services) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# Privacy
|
# Privacy GLOBAL
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# Disable Windows Recall and Copilot-AI hidden analysis "features":
|
# Disable Windows Recall and Copilot-AI hidden analysis "features":
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" -Name "DisableAIDataAnalysis" -Type DWord -Value 1
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" -Name "DisableAIDataAnalysis" -Type DWord -Value 1
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\WindowsAI" -Name "DisableAIDataAnalysis" -Type DWord -Value 1
|
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" -Name "TurnOffWindowsCopilot" -Type DWord -Value 1
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" -Name "TurnOffWindowsCopilot" -Type DWord -Value 1
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\WindowsCopilot" -Name "TurnOffWindowsCopilot" -Type DWord -Value 1
|
|
||||||
|
|
||||||
# Disable Tailored Experiences With Diagnostic Data:
|
# Disable Tailored Experiences With Diagnostic Data:
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" -Name "TailoredExperiencesWithDiagnosticDataEnabled" -Type DWord -Value 0
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" -Name "TailoredExperiencesWithDiagnosticDataEnabled" -Type DWord -Value 0
|
||||||
@ -139,27 +191,12 @@ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name
|
|||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 0
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 0
|
||||||
|
|
||||||
Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0
|
Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0
|
||||||
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) {
|
|
||||||
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force
|
|
||||||
}
|
|
||||||
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
|
||||||
New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force
|
||||||
}
|
}
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338393Enabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353694Enabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353696Enabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0
|
|
||||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
|
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
|
||||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force
|
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force
|
||||||
}
|
}
|
||||||
@ -185,52 +222,23 @@ netsh advfirewall firewall add rule name="Block Windows Telemetry out" dir=out a
|
|||||||
|
|
||||||
# Disable Advanced Data Collection:
|
# Disable Advanced Data Collection:
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\TabletPC" -Name "PreventHandwritingDataSharing" -Type DWord -Value 1
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\TabletPC" -Name "PreventHandwritingDataSharing" -Type DWord -Value 1
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Input\TIPC" -Name "Enabled" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name "HttpAcceptLanguageOptOut" -Type DWord -Value 1
|
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 1
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 1
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Name "PeriodInNanoSeconds" -Type QWord -Value ""
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Start_TrackProgs" -Type DWord -Value 0
|
|
||||||
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput")) {
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput")) {
|
||||||
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput" -Force
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput" -Force
|
||||||
}
|
}
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting" -Name "DontSendAdditionalData" -Type DWord -Value 1
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting" -Name "DontSendAdditionalData" -Type DWord -Value 1
|
||||||
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 1
|
|
||||||
Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting"
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting"
|
||||||
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
|
||||||
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\"
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\"
|
||||||
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config"
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config"
|
||||||
}
|
}
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0 -Force
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0 -Force
|
||||||
|
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput" -Name "AllowLinguisticDataCollection" -Type DWord -Value 0
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput" -Name "AllowLinguisticDataCollection" -Type DWord -Value 0
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 1
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsSpotlightFeatures" -Type DWord -Value 1
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\CloudContent" -Name "DisableThirdPartySuggestions" -Type DWord -Value 1
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# Usability
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# Restore Windows 10 context menu:
|
|
||||||
If (!(Test-Path "HKCU:\Software\CLASSES\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}")) {
|
|
||||||
New-Item -Path "HKCU:\Software\CLASSES\CLSID" -Name "{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}"
|
|
||||||
New-Item -Path "HKCU:\Software\CLASSES\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" -Name "InprocServer32"
|
|
||||||
}
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\CLASSES\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" -Name "(Default)" -Value ""
|
|
||||||
|
|
||||||
# Default Explorer view This PC:
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value "1"
|
|
||||||
|
|
||||||
# Show known file-extensions:
|
|
||||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value "0"
|
|
||||||
|
|
||||||
# Disable Thumbs.db File Creation on Network Shares
|
|
||||||
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v DisableThumbsDBOnNetworkFolders /d 0x1 /t REG_DWORD /f
|
|
||||||
|
|
||||||
# Disable OnlineTips:
|
# Disable OnlineTips:
|
||||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "AllowOnlineTips" -Type DWord -Value 0
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "AllowOnlineTips" -Type DWord -Value 0
|
||||||
|
|
||||||
# Register GIT_SSH for Putty
|
# Register GIT_SSH globaly for Putty
|
||||||
setx GIT_SSH "C:\Program Files\PuTTY\plink.exe"
|
setx GIT_SSH "C:\Program Files\PuTTY\plink.exe"
|
||||||
reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v GIT_SSH /d "C:\Program Files\PuTTY\plink.exe" /t REG_SZ /f
|
reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v GIT_SSH /d "C:\Program Files\PuTTY\plink.exe" /t REG_SZ /f
|
||||||
|
|
||||||
@ -250,15 +258,15 @@ if (!(Test-Path $env:LOCALAPPDATA\Microsoft\WindowsApps\winget.exe)){
|
|||||||
winget install -e Microsoft.WindowsTerminal --accept-source-agreements --accept-package-agreements --force --silent
|
winget install -e Microsoft.WindowsTerminal --accept-source-agreements --accept-package-agreements --force --silent
|
||||||
|
|
||||||
# Set Windows Terminal as Default Terminal
|
# Set Windows Terminal as Default Terminal
|
||||||
If (!(Test-Path "HKCU:\Console\%%Startup")) {
|
#If (!(Test-Path "HKCU:\Console\%%Startup")) {
|
||||||
New-Item -Path "HKCU:\Console\%%Startup"
|
# New-Item -Path "HKCU:\Console\%%Startup"
|
||||||
}
|
#}
|
||||||
Set-ItemProperty -Path "HKCU:\Console\%%Startup" -Name "DelegationConsole" -Type String -Value "{2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69}"
|
#Set-ItemProperty -Path "HKCU:\Console\%%Startup" -Name "DelegationConsole" -Type String -Value "{2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69}"
|
||||||
Set-ItemProperty -Path "HKCU:\Console\%%Startup" -Name "DelegationTerminal" -Type String -Value "{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}"
|
#Set-ItemProperty -Path "HKCU:\Console\%%Startup" -Name "DelegationTerminal" -Type String -Value "{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}"
|
||||||
|
|
||||||
Remove-Item -Path ".\Microsoft.VCLibs*.appx" -Force
|
Remove-Item -Path ".\Microsoft.VCLibs*.appx" -Force
|
||||||
Remove-Item -Path ".\Microsoft.DesktopAppInstaller_*.msixbundle" -Force
|
Remove-Item -Path ".\Microsoft.DesktopAppInstaller_*.msixbundle" -Force
|
||||||
|
|
||||||
# End of Script - Restart PC
|
# End of Script - Restart PC
|
||||||
Read-Host -Prompt "Success! Press any key to restart"
|
Read-Host -Prompt "Success! Press any key to restart"
|
||||||
Restart-Computer
|
Restart-Computer
|
||||||
|
Loading…
Reference in New Issue
Block a user