mirror of
https://github.com/Disassembler0/Win10-Initial-Setup-Script.git
synced 2026-01-11 23:18:19 -05:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ceca720bc7 | ||
|
|
96739c6b03 | ||
|
|
4483fbb161 | ||
|
|
076bfbdf75 | ||
|
|
294729dd12 | ||
|
|
d773b93d6f | ||
|
|
4f0f07c4d9 | ||
|
|
c45d596460 | ||
|
|
88d5a61c9c | ||
|
|
104f9a2e42 | ||
|
|
18cf6c04a6 | ||
|
|
5e9869d168 | ||
|
|
b15e555d11 | ||
|
|
7e1468c1ab | ||
|
|
f2ae6db9ce | ||
|
|
061947237a | ||
|
|
c4e9f0903a | ||
|
|
3ff5d90389 | ||
|
|
93a193d553 | ||
|
|
e5636b024b | ||
|
|
b76ef02ac2 | ||
|
|
a41cdbd9f1 | ||
|
|
dfc9dd10b7 |
@@ -1,7 +1,7 @@
|
||||
##########
|
||||
# Win 10 / Server 2016 / Server 2019 Initial Setup Script - Default preset
|
||||
# Author: Disassembler <disassembler@dasm.cz>
|
||||
# Version: v3.9, 2020-04-02
|
||||
# Version: v3.10, 2020-07-15
|
||||
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
|
||||
##########
|
||||
|
||||
@@ -10,12 +10,12 @@ RequireAdmin
|
||||
|
||||
### Privacy Tweaks ###
|
||||
DisableTelemetry # EnableTelemetry
|
||||
DisableCortana # EnableCortana
|
||||
DisableWiFiSense # EnableWiFiSense
|
||||
# DisableSmartScreen # EnableSmartScreen
|
||||
# DisableWebSearch # EnableWebSearch
|
||||
DisableAppSuggestions # EnableAppSuggestions
|
||||
DisableActivityHistory # EnableActivityHistory
|
||||
DisableBackgroundApps # EnableBackgroundApps
|
||||
# DisableSensors # EnableSensors
|
||||
DisableLocation # EnableLocation
|
||||
DisableMapUpdates # EnableMapUpdates
|
||||
@@ -23,7 +23,6 @@ DisableFeedback # EnableFeedback
|
||||
DisableTailoredExperiences # EnableTailoredExperiences
|
||||
DisableAdvertisingID # EnableAdvertisingID
|
||||
DisableWebLangList # EnableWebLangList
|
||||
DisableCortana # EnableCortana
|
||||
# DisableBiometrics # EnableBiometrics
|
||||
# DisableCamera # EnableCamera
|
||||
# DisableMicrophone # EnableMicrophone
|
||||
@@ -34,6 +33,24 @@ DisableWAPPush # EnableWAPPush
|
||||
# EnableClearRecentFiles # DisableClearRecentFiles
|
||||
# DisableRecentFiles # EnableRecentFiles
|
||||
|
||||
### UWP Privacy Tweaks ###
|
||||
DisableUWPBackgroundApps # EnableUWPBackgroundApps
|
||||
# DisableUWPVoiceActivation # EnableUWPVoiceActivation
|
||||
# DisableUWPNotifications # EnableUWPNotifications
|
||||
# DisableUWPAccountInfo # EnableUWPAccountInfo
|
||||
# DisableUWPContacts # EnableUWPContacts
|
||||
# DisableUWPCalendar # EnableUWPCalendar
|
||||
# DisableUWPPhoneCalls # EnableUWPPhoneCalls
|
||||
# DisableUWPCallHistory # EnableUWPCallHistory
|
||||
# DisableUWPEmail # EnableUWPEmail
|
||||
# DisableUWPTasks # EnableUWPTasks
|
||||
# DisableUWPMessaging # EnableUWPMessaging
|
||||
# DisableUWPRadios # EnableUWPRadios
|
||||
# DisableUWPOtherDevices # EnableUWPOtherDevices
|
||||
# DisableUWPDiagInfo # EnableUWPDiagInfo
|
||||
# DisableUWPFileSystem # EnableUWPFileSystem
|
||||
# DisableUWPSwapFile # EnableUWPSwapFile
|
||||
|
||||
### Security Tweaks ###
|
||||
# SetUACLow # SetUACHigh
|
||||
# EnableSharingMappedDrives # DisableSharingMappedDrives
|
||||
@@ -92,7 +109,6 @@ DisableAutorun # EnableAutorun
|
||||
# DisableDefragmentation # EnableDefragmentation
|
||||
# DisableSuperfetch # EnableSuperfetch
|
||||
# DisableIndexing # EnableIndexing
|
||||
# DisableSwapFile # EnableSwapFile
|
||||
# DisableRecycleBin # EnableRecycleBin
|
||||
EnableNTFSLongPaths # DisableNTFSLongPaths
|
||||
# DisableNTFSLastAccess # EnableNTFSLastAccess
|
||||
@@ -126,12 +142,14 @@ DisableSearchAppInStore # EnableSearchAppInStore
|
||||
DisableNewAppPrompt # EnableNewAppPrompt
|
||||
# HideRecentlyAddedApps # ShowRecentlyAddedApps
|
||||
# HideMostUsedApps # ShowMostUsedApps
|
||||
# SetWinXMenuPowerShell # SetWinXMenuCmd
|
||||
# SetControlPanelSmallIcons # SetControlPanelLargeIcons # SetControlPanelCategories
|
||||
DisableShortcutInName # EnableShortcutInName
|
||||
# HideShortcutArrow # ShowShortcutArrow
|
||||
SetVisualFXPerformance # SetVisualFXAppearance
|
||||
# EnableTitleBarColor # DisableTitleBarColor
|
||||
# EnableDarkTheme # DisableDarkTheme
|
||||
# SetAppsDarkMode # SetAppsLightMode
|
||||
# SetSystemLightMode # SetSystemDarkMode
|
||||
# AddENKeyboard # RemoveENKeyboard
|
||||
# EnableNumlock # DisableNumlock
|
||||
# DisableEnhPointerPrecision # EnableEnhPointerPrecision
|
||||
@@ -150,6 +168,7 @@ ShowHiddenFiles # HideHiddenFiles
|
||||
# ShowFolderMergeConflicts # HideFolderMergeConflicts
|
||||
EnableNavPaneExpand # DisableNavPaneExpand
|
||||
# ShowNavPaneAllFolders # HideNavPaneAllFolders
|
||||
# ShowNavPaneLibraries # HideNavPaneLibraries
|
||||
# EnableFldrSeparateProcess # DisableFldrSeparateProcess
|
||||
# EnableRestoreFldrWindows # DisableRestoreFldrWindows
|
||||
# ShowEncCompFilesColor # HideEncCompFilesColor
|
||||
@@ -164,6 +183,7 @@ ShowThisPCOnDesktop # HideThisPCFromDesktop
|
||||
# ShowUserFolderOnDesktop # HideUserFolderFromDesktop
|
||||
# ShowControlPanelOnDesktop # HideControlPanelFromDesktop
|
||||
# ShowNetworkOnDesktop # HideNetworkFromDesktop
|
||||
# HideDesktopIcons # ShowDesktopIcons
|
||||
# ShowBuildNumberOnDesktop # HideBuildNumberFromDesktop
|
||||
HideDesktopFromThisPC # ShowDesktopInThisPC
|
||||
# HideDesktopFromExplorer # ShowDesktopInExplorer
|
||||
@@ -179,6 +199,7 @@ HideVideosFromThisPC # ShowVideosInThisPC
|
||||
# HideVideosFromExplorer # ShowVideosInExplorer
|
||||
Hide3DObjectsFromThisPC # Show3DObjectsInThisPC
|
||||
# Hide3DObjectsFromExplorer # Show3DObjectsInExplorer
|
||||
# HideNetworkFromExplorer # ShowNetworkInExplorer
|
||||
# HideIncludeInLibraryMenu # ShowIncludeInLibraryMenu
|
||||
# HideGiveAccessToMenu # ShowGiveAccessToMenu
|
||||
# HideShareMenu # ShowShareMenu
|
||||
@@ -200,6 +221,7 @@ DisableEdgeShortcutCreation # EnableEdgeShortcutCreation
|
||||
DisableIEFirstRun # EnableIEFirstRun
|
||||
DisableFirstLogonAnimation # EnableFirstLogonAnimation
|
||||
DisableMediaSharing # EnableMediaSharing
|
||||
# DisableMediaOnlineAccess # EnableMediaOnlineAccess
|
||||
# EnableDeveloperMode # DisableDeveloperMode
|
||||
# UninstallMediaPlayer # InstallMediaPlayer
|
||||
# UninstallInternetExplorer # InstallInternetExplorer
|
||||
@@ -212,6 +234,7 @@ DisableMediaSharing # EnableMediaSharing
|
||||
# InstallHyperV # UninstallHyperV
|
||||
# UninstallSSHClient # InstallSSHClient
|
||||
# InstallSSHServer # UninstallSSHServer
|
||||
# InstallTelnetClient # UninstallTelnetClient
|
||||
# InstallNET23 # UninstallNET23
|
||||
SetPhotoViewerAssociation # UnsetPhotoViewerAssociation
|
||||
AddPhotoViewerOpenWith # RemovePhotoViewerOpenWith
|
||||
|
||||
15
README.md
15
README.md
@@ -1,3 +1,15 @@
|
||||
## The project is archived
|
||||
|
||||
This project has been archived because I no longer use Windows. I grew tired with the system being unable to keep itself configured in the desired state, group policies randomly stopping working for hundreds of managed workstations at once, advertisements, unwanted tips and content popping up on various places throughout the user interface, and incompetent support even for enterprise products. Ultimately I have migrated virtually all my servers, workstations and laptops to linux. Even though there are areas where the open source products are still lacking, the transparency, configurability and reliability greatly outweighs the drawbacks for me.
|
||||
|
||||
I also lost faith in humanity throughout the years I was actively maintaining the project. The influx of pings, bumps, repeating questions already answered in FAQ, and various other unreasonable demands without any givebacks was just astounding. Please do not contact me regarding this project as I have no desire to invest any more time into it. As per MIT license, you're still free to use, modify, and distribute the code further, as long as you keep the license and copyright notice.
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Contents
|
||||
- [Description](#description)
|
||||
- [Usage](#usage)
|
||||
@@ -84,7 +96,8 @@ The script supports command line options and parameters which can help you custo
|
||||
| 1809 | Redstone 5 (RS5) | October 2018 Update | 17763 |
|
||||
| 1903 | 19H1 | May 2019 Update | 18362 |
|
||||
| 1909 | 19H2 | November 2019 Update | 18363 |
|
||||
| 2004 | 20H1 | TBA | 19041 |
|
||||
| 2004 | 20H1 | May 2020 Update | 19041 |
|
||||
| 20H2 | 20H2 | October 2020 Update | 19042 |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
##########
|
||||
# Win 10 / Server 2016 / Server 2019 Initial Setup Script - Main execution loop
|
||||
# Author: Disassembler <disassembler@dasm.cz>
|
||||
# Version: v3.9, 2020-04-02
|
||||
# Version: v3.10, 2020-07-15
|
||||
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
|
||||
##########
|
||||
|
||||
|
||||
568
Win10.psm1
568
Win10.psm1
@@ -1,7 +1,7 @@
|
||||
##########
|
||||
# Win 10 / Server 2016 / Server 2019 Initial Setup Script - Tweak library
|
||||
# Author: Disassembler <disassembler@dasm.cz>
|
||||
# Version: v3.9, 2020-04-02
|
||||
# Version: v3.10, 2020-07-15
|
||||
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
|
||||
##########
|
||||
|
||||
@@ -54,6 +54,10 @@ Function DisableTelemetry {
|
||||
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null
|
||||
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null
|
||||
Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null
|
||||
# Office 2016 / 2019
|
||||
Disable-ScheduledTask -TaskName "Microsoft\Office\Office ClickToRun Service Monitor" -ErrorAction SilentlyContinue | Out-Null
|
||||
Disable-ScheduledTask -TaskName "Microsoft\Office\OfficeTelemetryAgentFallBack2016" -ErrorAction SilentlyContinue | Out-Null
|
||||
Disable-ScheduledTask -TaskName "Microsoft\Office\OfficeTelemetryAgentLogOn2016" -ErrorAction SilentlyContinue | Out-Null
|
||||
}
|
||||
|
||||
# Enable Telemetry
|
||||
@@ -76,6 +80,50 @@ Function EnableTelemetry {
|
||||
Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null
|
||||
Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null
|
||||
Enable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null
|
||||
# Office 2016 / 2019
|
||||
Enable-ScheduledTask -TaskName "Microsoft\Office\Office ClickToRun Service Monitor" -ErrorAction SilentlyContinue | Out-Null
|
||||
Enable-ScheduledTask -TaskName "Microsoft\Office\OfficeTelemetryAgentFallBack2016" -ErrorAction SilentlyContinue | Out-Null
|
||||
Enable-ScheduledTask -TaskName "Microsoft\Office\OfficeTelemetryAgentLogOn2016" -ErrorAction SilentlyContinue | Out-Null
|
||||
}
|
||||
|
||||
# Disable Cortana
|
||||
Function DisableCortana {
|
||||
Write-Output "Disabling Cortana..."
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\Personalization\Settings")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowCortanaButton" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Experience\AllowCortana" -Name "Value" -Type DWord -Value 0
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Name "AllowInputPersonalization" -Type DWord -Value 0
|
||||
Get-AppxPackage "Microsoft.549981C3F5F10" | Remove-AppxPackage
|
||||
}
|
||||
|
||||
# Enable Cortana
|
||||
Function EnableCortana {
|
||||
Write-Output "Enabling Cortana..."
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -ErrorAction SilentlyContinue
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -ErrorAction SilentlyContinue
|
||||
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowCortanaButton" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Experience\AllowCortana" -Name "Value" -Type DWord -Value 1
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Name "AllowInputPersonalization" -ErrorAction SilentlyContinue
|
||||
Get-AppxPackage -AllUsers "Microsoft.549981C3F5F10" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
||||
}
|
||||
|
||||
# Disable Wi-Fi Sense
|
||||
@@ -204,7 +252,7 @@ Function EnableAppSuggestions {
|
||||
}
|
||||
|
||||
# Disable Activity History feed in Task View
|
||||
# Note: The checkbox "Let Windows collect my activities from this PC" remains checked even when the function is disabled
|
||||
# Note: The checkbox "Store my activity history on this device" ("Let Windows collect my activities from this PC" on older versions) remains checked even when the function is disabled
|
||||
Function DisableActivityHistory {
|
||||
Write-Output "Disabling Activity History..."
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 0
|
||||
@@ -220,30 +268,6 @@ Function EnableActivityHistory {
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable Background application access - ie. if apps can download or update when they aren't used
|
||||
# Cortana (resp. Search since 2004) is excluded as its inclusion breaks start menu search, ShellExperienceHost breaks toasts and notifications
|
||||
Function DisableBackgroundApps {
|
||||
Write-Output "Disabling Background application access..."
|
||||
If ([System.Environment]::OSVersion.Version.Build -ge 19041) {
|
||||
$exclude = "Microsoft.Windows.Search*", "Microsoft.Windows.ShellExperienceHost*"
|
||||
} Else {
|
||||
$exclude = "Microsoft.Windows.Cortana*", "Microsoft.Windows.ShellExperienceHost*"
|
||||
}
|
||||
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude $exclude | ForEach-Object {
|
||||
Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -Value 1
|
||||
}
|
||||
}
|
||||
|
||||
# Enable Background application access
|
||||
Function EnableBackgroundApps {
|
||||
Write-Output "Enabling Background application access..."
|
||||
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" | ForEach-Object {
|
||||
Remove-ItemProperty -Path $_.PsPath -Name "Disabled" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
# Disable sensor features, such as screen auto rotation
|
||||
Function DisableSensors {
|
||||
Write-Output "Disabling sensors..."
|
||||
@@ -351,43 +375,8 @@ Function EnableWebLangList {
|
||||
Remove-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name "HttpAcceptLanguageOptOut" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable Cortana
|
||||
Function DisableCortana {
|
||||
Write-Output "Disabling Cortana..."
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\Personalization\Settings")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Experience\AllowCortana" -Name "Value" -Type DWord -Value 0
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Name "AllowInputPersonalization" -Type DWord -Value 0
|
||||
}
|
||||
|
||||
# Enable Cortana
|
||||
Function EnableCortana {
|
||||
Write-Output "Enabling Cortana..."
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -ErrorAction SilentlyContinue
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -ErrorAction SilentlyContinue
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Experience\AllowCortana" -Name "Value" -Type DWord -Value 1
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Name "AllowInputPersonalization" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable biometric features in Windows. Note - it's recommended to create a password recovery disk, if you log on using biometrics.
|
||||
# Disable biometric features
|
||||
# Note: If you log on using biometrics (fingerprint, Windows Hello etc.) it's recommended to create a password recovery disk before applying this tweak.
|
||||
Function DisableBiometrics {
|
||||
Write-Output "Disabling biometric services..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Biometrics")) {
|
||||
@@ -402,33 +391,35 @@ Function EnableBiometrics {
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" -Name "Enabled" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to camera from ModernUI applications
|
||||
# Disable access to camera
|
||||
# Note: This disables access using standard Windows API. Direct access to device will still be allowed.
|
||||
Function DisableCamera {
|
||||
Write-Output "Disabling access to camera from ModernUI applications..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera" -Force | Out-Null
|
||||
Write-Output "Disabling access to camera..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera" -Name "AllowCamera" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessCamera" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to camera in ModernUI applications
|
||||
# Enable access to camera
|
||||
Function EnableCamera {
|
||||
Write-Output "Enabling access to camera from ModernUI applications..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera" -Name "AllowCamera" -ErrorAction SilentlyContinue
|
||||
Write-Output "Enabling access to camera..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessCamera" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to microphone in ModernUI applications
|
||||
# Disable access to microphone
|
||||
# Note: This disables access using standard Windows API. Direct access to device will still be allowed.
|
||||
Function DisableMicrophone {
|
||||
Write-Output "Disabling access to microphone in ModernUI applications..."
|
||||
Write-Output "Disabling access to microphone..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessMicrophone" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to microphone in ModernUI applications
|
||||
# Enable access to microphone
|
||||
Function EnableMicrophone {
|
||||
Write-Output "Enabling access to microphone from ModernUI applications..."
|
||||
Write-Output "Enabling access to microphone..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessMicrophone" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
@@ -476,7 +467,7 @@ Function SetP2PUpdateInternet {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 3
|
||||
} ElseIf ([System.Environment]::OSVersion.Version.Build -eq 14393) {
|
||||
} ElseIf ([System.Environment]::OSVersion.Version.Build -le 14393) {
|
||||
# Method used in 1511 and 1607
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" -Name "DODownloadMode" -ErrorAction SilentlyContinue
|
||||
} Else {
|
||||
@@ -575,6 +566,273 @@ Function EnableRecentFiles {
|
||||
|
||||
|
||||
|
||||
##########
|
||||
#region UWP Privacy Tweaks
|
||||
##########
|
||||
# Universal Windows Platform (UWP) is an API for common application and device controls unified for all devices capable of running Windows 10.
|
||||
# UWP applications are running sandboxed and the user can control devices and capabilities available to them.
|
||||
|
||||
# Disable UWP apps background access - ie. if UWP apps can download data or update themselves when they aren't used
|
||||
# Until 1809, Cortana and ShellExperienceHost need to be explicitly excluded as their inclusion breaks start menu search and toast notifications respectively.
|
||||
Function DisableUWPBackgroundApps {
|
||||
Write-Output "Disabling UWP apps background access..."
|
||||
If ([System.Environment]::OSVersion.Version.Build -ge 17763) {
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsRunInBackground" -Type DWord -Value 2
|
||||
} Else {
|
||||
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*", "Microsoft.Windows.ShellExperienceHost*" | ForEach-Object {
|
||||
Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -Value 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Enable UWP apps background access
|
||||
Function EnableUWPBackgroundApps {
|
||||
Write-Output "Enabling UWP apps background access..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsRunInBackground" -ErrorAction SilentlyContinue
|
||||
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" | ForEach-Object {
|
||||
Remove-ItemProperty -Path $_.PsPath -Name "Disabled" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
# Disable access to voice activation from UWP apps
|
||||
Function DisableUWPVoiceActivation {
|
||||
Write-Output "Disabling access to voice activation from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsActivateWithVoice" -Type DWord -Value 2
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsActivateWithVoiceAboveLock" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to voice activation from UWP apps
|
||||
Function EnableUWPVoiceActivation {
|
||||
Write-Output "Enabling access to voice activation from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsActivateWithVoice" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsActivateWithVoiceAboveLock" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to notifications from UWP apps
|
||||
Function DisableUWPNotifications {
|
||||
Write-Output "Disabling access to notifications from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessNotifications" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to notifications from UWP apps
|
||||
Function EnableUWPNotifications {
|
||||
Write-Output "Enabling access to notifications from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessNotifications" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to account info from UWP apps
|
||||
Function DisableUWPAccountInfo {
|
||||
Write-Output "Disabling access to account info from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessAccountInfo" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to account info from UWP apps
|
||||
Function EnableUWPAccountInfo {
|
||||
Write-Output "Enabling access to account info from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessAccountInfo" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to contacts from UWP apps
|
||||
Function DisableUWPContacts {
|
||||
Write-Output "Disabling access to contacts from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessContacts" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to contacts from UWP apps
|
||||
Function EnableUWPContacts {
|
||||
Write-Output "Enabling access to contacts from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessContacts" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to calendar from UWP apps
|
||||
Function DisableUWPCalendar {
|
||||
Write-Output "Disabling access to calendar from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessCalendar" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to calendar from UWP apps
|
||||
Function EnableUWPCalendar {
|
||||
Write-Output "Enabling access to calendar from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessCalendar" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to phone calls from UWP apps
|
||||
Function DisableUWPPhoneCalls {
|
||||
Write-Output "Disabling access to phone calls from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessPhone" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to phone calls from UWP apps
|
||||
Function EnableUWPPhoneCalls {
|
||||
Write-Output "Enabling access to phone calls from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessPhone" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to call history from UWP apps
|
||||
Function DisableUWPCallHistory {
|
||||
Write-Output "Disabling access to call history from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessCallHistory" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to call history from UWP apps
|
||||
Function EnableUWPCallHistory {
|
||||
Write-Output "Enabling access to call history from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessCallHistory" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to email from UWP apps
|
||||
Function DisableUWPEmail {
|
||||
Write-Output "Disabling access to email from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessEmail" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to email from UWP apps
|
||||
Function EnableUWPEmail {
|
||||
Write-Output "Enabling access to email from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessEmail" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to tasks from UWP apps
|
||||
Function DisableUWPTasks {
|
||||
Write-Output "Disabling access to tasks from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessTasks" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to tasks from UWP apps
|
||||
Function EnableUWPTasks {
|
||||
Write-Output "Enabling access to tasks from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessTasks" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to messaging (SMS, MMS) from UWP apps
|
||||
Function DisableUWPMessaging {
|
||||
Write-Output "Disabling access to messaging from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessMessaging" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to messaging from UWP apps
|
||||
Function EnableUWPMessaging {
|
||||
Write-Output "Enabling access to messaging from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessMessaging" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to radios (e.g. Bluetooth) from UWP apps
|
||||
Function DisableUWPRadios {
|
||||
Write-Output "Disabling access to radios from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessRadios" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to radios from UWP apps
|
||||
Function EnableUWPRadios {
|
||||
Write-Output "Enabling access to radios from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessRadios" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to other devices (unpaired, beacons, TVs etc.) from UWP apps
|
||||
Function DisableUWPOtherDevices {
|
||||
Write-Output "Disabling access to other devices from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsSyncWithDevices" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to other devices from UWP apps
|
||||
Function EnableUWPOtherDevices {
|
||||
Write-Output "Enabling access to other devices from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsSyncWithDevices" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to diagnostic information from UWP apps
|
||||
Function DisableUWPDiagInfo {
|
||||
Write-Output "Disabling access to diagnostic information from UWP apps..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsGetDiagnosticInfo" -Type DWord -Value 2
|
||||
}
|
||||
|
||||
# Enable access to diagnostic information from UWP apps
|
||||
Function EnableUWPDiagInfo {
|
||||
Write-Output "Enabling access to diagnostic information from UWP apps..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsGetDiagnosticInfo" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable access to libraries and file system from UWP apps
|
||||
Function DisableUWPFileSystem {
|
||||
Write-Output "Disabling access to libraries and file system from UWP apps..."
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary" -Name "Value" -Type String -Value "Deny"
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary" -Name "Value" -Type String -Value "Deny"
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary" -Name "Value" -Type String -Value "Deny"
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess" -Name "Value" -Type String -Value "Deny"
|
||||
}
|
||||
|
||||
# Enable access to libraries and file system from UWP apps
|
||||
Function EnableUWPFileSystem {
|
||||
Write-Output "Enabling access to libraries and file system from UWP apps..."
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary" -Name "Value" -Type String -Value "Allow"
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary" -Name "Value" -Type String -Value "Allow"
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary" -Name "Value" -Type String -Value "Allow"
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess" -Name "Value" -Type String -Value "Allow"
|
||||
}
|
||||
|
||||
# Disable UWP apps swap file
|
||||
# This disables creation and use of swapfile.sys and frees 256 MB of disk space. Swapfile.sys is used only by UWP apps. The tweak has no effect on the real swap in pagefile.sys.
|
||||
Function DisableUWPSwapFile {
|
||||
Write-Output "Disabling UWP apps swap file..."
|
||||
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "SwapfileControl" -Type Dword -Value 0
|
||||
}
|
||||
|
||||
# Enable UWP apps swap file
|
||||
Function EnableUWPSwapFile {
|
||||
Write-Output "Enabling UWP apps swap file..."
|
||||
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "SwapfileControl" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
##########
|
||||
#endregion UWP Privacy Tweaks
|
||||
##########
|
||||
|
||||
|
||||
|
||||
##########
|
||||
#region Security Tweaks
|
||||
##########
|
||||
@@ -608,12 +866,14 @@ Function DisableSharingMappedDrives {
|
||||
# Disable implicit administrative shares
|
||||
Function DisableAdminShares {
|
||||
Write-Output "Disabling implicit administrative shares..."
|
||||
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareServer" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -Type DWord -Value 0
|
||||
}
|
||||
|
||||
# Enable implicit administrative shares
|
||||
Function EnableAdminShares {
|
||||
Write-Output "Enabling implicit administrative shares..."
|
||||
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareServer" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
@@ -1166,9 +1426,7 @@ Function DisableUpdateDriver {
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value 0
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" | Out-Null
|
||||
}
|
||||
@@ -1179,9 +1437,7 @@ Function DisableUpdateDriver {
|
||||
Function EnableUpdateDriver {
|
||||
Write-Output "Enabling driver offering through Windows Update..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "SearchOrderConfig" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
@@ -1389,19 +1645,6 @@ Function EnableIndexing {
|
||||
Start-Service "WSearch" -WarningAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable Modern UI swap file
|
||||
# This disables creation and use of swapfile.sys and frees 256 MB of disk space. Swapfile.sys is used only by Modern UI apps. The tweak has no effect on the real swap in pagefile.sys.
|
||||
Function DisableSwapFile {
|
||||
Write-Output "Disabling Modern UI swap file..."
|
||||
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "SwapfileControl" -Type Dword -Value 0
|
||||
}
|
||||
|
||||
# Enable Modern UI swap file
|
||||
Function EnableSwapFile {
|
||||
Write-Output "Enabling Modern UI swap file..."
|
||||
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "SwapfileControl" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable Recycle Bin - Files will be permanently deleted without placing into Recycle Bin
|
||||
Function DisableRecycleBin {
|
||||
Write-Output "Disabling Recycle Bin..."
|
||||
@@ -1901,6 +2144,26 @@ Function ShowMostUsedApps {
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoStartMenuMFUprogramsList" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Set PowerShell instead of Command prompt in Start Button context menu (Win+X) - Default since 1703
|
||||
Function SetWinXMenuPowerShell {
|
||||
Write-Output "Setting PowerShell instead of Command prompt in WinX menu..."
|
||||
If ([System.Environment]::OSVersion.Version.Build -le 14393) {
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DontUsePowerShellOnWinX" -Type DWord -Value 0
|
||||
} Else {
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DontUsePowerShellOnWinX" -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
# Set Command prompt instead of PowerShell in Start Button context menu (Win+X) - Default in 1507 - 1607
|
||||
Function SetWinXMenuCmd {
|
||||
Write-Output "Setting Command prompt instead of PowerShell in WinX menu..."
|
||||
If ([System.Environment]::OSVersion.Version.Build -le 14393) {
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DontUsePowerShellOnWinX" -ErrorAction SilentlyContinue
|
||||
} Else {
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DontUsePowerShellOnWinX" -Type DWord -Value 1
|
||||
}
|
||||
}
|
||||
|
||||
# Set Control Panel view to Small icons (Classic)
|
||||
Function SetControlPanelSmallIcons {
|
||||
Write-Output "Setting Control Panel view to small icons..."
|
||||
@@ -1997,16 +2260,28 @@ Function DisableTitleBarColor {
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "ColorPrevalence" -Type DWord -Value 0
|
||||
}
|
||||
|
||||
# Enable Dark Theme
|
||||
Function EnableDarkTheme {
|
||||
Write-Output "Enabling Dark Theme..."
|
||||
# Set Dark Mode for Applications
|
||||
Function SetAppsDarkMode {
|
||||
Write-Output "Setting Dark Mode for Applications..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "AppsUseLightTheme" -Type DWord -Value 0
|
||||
}
|
||||
|
||||
# Disable Dark Theme
|
||||
Function DisableDarkTheme {
|
||||
Write-Output "Disabling Dark Theme..."
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "AppsUseLightTheme" -ErrorAction SilentlyContinue
|
||||
# Set Light Mode for Applications
|
||||
Function SetAppsLightMode {
|
||||
Write-Output "Setting Light Mode for Applications..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "AppsUseLightTheme" -Type DWord -Value 1
|
||||
}
|
||||
|
||||
# Set Light Mode for System - Applicable since 1903
|
||||
Function SetSystemLightMode {
|
||||
Write-Output "Setting Light Mode for System..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "SystemUsesLightTheme" -Type DWord -Value 1
|
||||
}
|
||||
|
||||
# Set Dark Mode for System - Applicable since 1903
|
||||
Function SetSystemDarkMode {
|
||||
Write-Output "Setting Dark Mode for System..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "SystemUsesLightTheme" -Type DWord -Value 0
|
||||
}
|
||||
|
||||
# Add secondary en-US keyboard
|
||||
@@ -2281,12 +2556,27 @@ Function ShowNavPaneAllFolders {
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "NavPaneShowAllFolders" -Type DWord -Value 1
|
||||
}
|
||||
|
||||
# Hide all folders in Explorer navigation pane except the basic ones (Quick access, OneDrive, This PC, Network), some of which can be disabled using other tweaks
|
||||
# Hide all folders from Explorer navigation pane except the basic ones (Quick access, OneDrive, This PC, Network), some of which can be disabled using other tweaks
|
||||
Function HideNavPaneAllFolders {
|
||||
Write-Output "Hiding all folders in Explorer navigation pane (except the basic ones)..."
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "NavPaneShowAllFolders" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Show Libraries in Explorer navigation pane
|
||||
Function ShowNavPaneLibraries {
|
||||
Write-Output "Showing Libraries icon in Explorer namespace..."
|
||||
If (!(Test-Path "HKCU:\Software\Classes\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}")) {
|
||||
New-Item -Path "HKCU:\Software\Classes\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Classes\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}" -Name "System.IsPinnedToNameSpaceTree" -Type DWord -Value 1
|
||||
}
|
||||
|
||||
# Hide Libraries from Explorer navigation pane
|
||||
Function HideNavPaneLibraries {
|
||||
Write-Output "Hiding Libraries icon from Explorer namespace..."
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Classes\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}" -Name "System.IsPinnedToNameSpaceTree" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Enable launching folder windows in a separate process
|
||||
Function EnableFldrSeparateProcess {
|
||||
Write-Output "Enabling launching folder windows in a separate process..."
|
||||
@@ -2498,6 +2788,18 @@ Function HideNetworkFromDesktop {
|
||||
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Hide all icons from desktop
|
||||
Function HideDesktopIcons {
|
||||
Write-Output "Hiding all icons from desktop..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideIcons" -Value 1
|
||||
}
|
||||
|
||||
# Show all icons on desktop
|
||||
Function ShowDesktopIcons {
|
||||
Write-Output "Showing all icons on desktop..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideIcons" -Value 0
|
||||
}
|
||||
|
||||
# Show Windows build number and Windows edition (Home/Pro/Enterprise) from bottom right of desktop
|
||||
Function ShowBuildNumberOnDesktop {
|
||||
Write-Output "Showing Windows build number on desktop..."
|
||||
@@ -2732,6 +3034,18 @@ Function Show3DObjectsInExplorer {
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name "ThisPCPolicy" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Hide Network icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs
|
||||
Function HideNetworkFromExplorer {
|
||||
Write-Output "Hiding Network icon from Explorer namespace..."
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\NonEnum" -Name "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" -Type DWord -Value 1
|
||||
}
|
||||
|
||||
# Show Network icon in Explorer namespace
|
||||
Function ShowNetworkInExplorer {
|
||||
Write-Output "Showing Network icon in Explorer namespace..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\NonEnum" -Name "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Hide 'Include in library' context menu item
|
||||
Function HideIncludeInLibraryMenu {
|
||||
Write-Output "Hiding 'Include in library' context menu item..."
|
||||
@@ -3272,7 +3586,7 @@ Function EnableFirstLogonAnimation {
|
||||
|
||||
# Disable Windows Media Player's media sharing feature
|
||||
Function DisableMediaSharing {
|
||||
Write-Output "Disabling media sharing..."
|
||||
Write-Output "Disabling Windows Media Player media sharing..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" -Force | Out-Null
|
||||
}
|
||||
@@ -3281,10 +3595,34 @@ Function DisableMediaSharing {
|
||||
|
||||
# Enable Windows Media Player's media sharing feature
|
||||
Function EnableMediaSharing {
|
||||
Write-Output "Enabling media sharing..."
|
||||
Write-Output "Enabling Windows Media Player media sharing..."
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" -Name "PreventLibrarySharing" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Disable Windows Media Player online access - audio file metadata download, radio presets, DRM.
|
||||
Function DisableMediaOnlineAccess {
|
||||
Write-Output "Disabling Windows Media Player online access..."
|
||||
If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer")) {
|
||||
New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" -Name "PreventCDDVDMetadataRetrieval" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" -Name "PreventMusicFileMetadataRetrieval" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" -Name "PreventRadioPresetsRetrieval" -Type DWord -Value 1
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\WMDRM")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\WMDRM" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WMDRM" -Name "DisableOnline" -Type DWord -Value 1
|
||||
}
|
||||
|
||||
# Enable Windows Media Player online access
|
||||
Function EnableMediaOnlineAccess {
|
||||
Write-Output "Enabling Windows Media Player online access..."
|
||||
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" -Name "PreventCDDVDMetadataRetrieval" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" -Name "PreventMusicFileMetadataRetrieval" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" -Name "PreventRadioPresetsRetrieval" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WMDRM" -Name "DisableOnline" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Enable Developer Mode
|
||||
Function EnableDeveloperMode {
|
||||
Write-Output "Enabling Developer Mode..."
|
||||
@@ -3456,6 +3794,26 @@ Function UninstallSSHServer {
|
||||
Get-WindowsCapability -Online | Where-Object { $_.Name -like "OpenSSH.Server*" } | Remove-WindowsCapability -Online | Out-Null
|
||||
}
|
||||
|
||||
# Install Telnet Client
|
||||
Function InstallTelnetClient {
|
||||
Write-Output "Installing Telnet Client..."
|
||||
If ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) {
|
||||
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "TelnetClient" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
|
||||
} Else {
|
||||
Install-WindowsFeature -Name "Telnet-Client" -WarningAction SilentlyContinue | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
# Uninstall Telnet Client
|
||||
Function UninstallTelnetClient {
|
||||
Write-Output "Uninstalling Telnet Client..."
|
||||
If ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) {
|
||||
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "TelnetClient" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
|
||||
} Else {
|
||||
Uninstall-WindowsFeature -Name "Telnet-Client" -WarningAction SilentlyContinue | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
# Install .NET Framework 2.0, 3.0 and 3.5 runtimes - Requires internet connection
|
||||
Function InstallNET23 {
|
||||
Write-Output "Installing .NET Framework 2.0, 3.0 and 3.5 runtimes..."
|
||||
|
||||
Reference in New Issue
Block a user