@@ -220,30 +220,6 @@ Function EnableActivityHistory {
220
220
Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" - Name " UploadUserActivities" - ErrorAction SilentlyContinue
221
221
}
222
222
223
- # Disable Background application access - ie. if apps can download or update when they aren't used
224
- # Cortana (resp. Search since 2004) is excluded as its inclusion breaks start menu search, ShellExperienceHost breaks toasts and notifications
225
- Function DisableBackgroundApps {
226
- Write-Output " Disabling Background application access..."
227
- If ([System.Environment ]::OSVersion.Version.Build -ge 19041 ) {
228
- $exclude = " Microsoft.Windows.Search*" , " Microsoft.Windows.ShellExperienceHost*"
229
- } Else {
230
- $exclude = " Microsoft.Windows.Cortana*" , " Microsoft.Windows.ShellExperienceHost*"
231
- }
232
- Get-ChildItem - Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" - Exclude $exclude | ForEach-Object {
233
- Set-ItemProperty - Path $_.PsPath - Name " Disabled" - Type DWord - Value 1
234
- Set-ItemProperty - Path $_.PsPath - Name " DisabledByUser" - Type DWord - Value 1
235
- }
236
- }
237
-
238
- # Enable Background application access
239
- Function EnableBackgroundApps {
240
- Write-Output " Enabling Background application access..."
241
- Get-ChildItem - Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" | ForEach-Object {
242
- Remove-ItemProperty - Path $_.PsPath - Name " Disabled" - ErrorAction SilentlyContinue
243
- Remove-ItemProperty - Path $_.PsPath - Name " DisabledByUser" - ErrorAction SilentlyContinue
244
- }
245
- }
246
-
247
223
# Disable sensor features, such as screen auto rotation
248
224
Function DisableSensors {
249
225
Write-Output " Disabling sensors..."
@@ -578,6 +554,273 @@ Function EnableRecentFiles {
578
554
579
555
580
556
557
+ # #########
558
+ # region UWP Privacy Tweaks
559
+ # #########
560
+ # Universal Windows Platform (UWP) is an API for common application and device controls unified for all devices capable of running Windows 10.
561
+ # UWP applications are running sandboxed and the user can control devices and capabilities available to them.
562
+
563
+ # Disable UWP apps background access - ie. if UWP apps can download data or update themselves when they aren't used
564
+ # Until 1809, Cortana and ShellExperienceHost need to be explicitly excluded as their inclusion breaks start menu search and toast notifications respectively.
565
+ Function DisableUWPBackgroundApps {
566
+ Write-Output " Disabling UWP apps background access..."
567
+ If ([System.Environment ]::OSVersion.Version.Build -ge 17763 ) {
568
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
569
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
570
+ }
571
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsRunInBackground" - Type DWord - Value 2
572
+ } Else {
573
+ Get-ChildItem - Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" - Exclude " Microsoft.Windows.Cortana*" , " Microsoft.Windows.ShellExperienceHost*" | ForEach-Object {
574
+ Set-ItemProperty - Path $_.PsPath - Name " Disabled" - Type DWord - Value 1
575
+ Set-ItemProperty - Path $_.PsPath - Name " DisabledByUser" - Type DWord - Value 1
576
+ }
577
+ }
578
+ }
579
+
580
+ # Enable UWP apps background access
581
+ Function EnableUWPBackgroundApps {
582
+ Write-Output " Enabling UWP apps background access..."
583
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsRunInBackground" - ErrorAction SilentlyContinue
584
+ Get-ChildItem - Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" | ForEach-Object {
585
+ Remove-ItemProperty - Path $_.PsPath - Name " Disabled" - ErrorAction SilentlyContinue
586
+ Remove-ItemProperty - Path $_.PsPath - Name " DisabledByUser" - ErrorAction SilentlyContinue
587
+ }
588
+ }
589
+
590
+ # Disable access to voice activation from UWP apps
591
+ Function DisableUWPVoiceActivation {
592
+ Write-Output " Disabling access to voice activation from UWP apps..."
593
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
594
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
595
+ }
596
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsActivateWithVoice" - Type DWord - Value 2
597
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsActivateWithVoiceAboveLock" - Type DWord - Value 2
598
+ }
599
+
600
+ # Enable access to voice activation from UWP apps
601
+ Function EnableUWPVoiceActivation {
602
+ Write-Output " Enabling access to voice activation from UWP apps..."
603
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsActivateWithVoice" - ErrorAction SilentlyContinue
604
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsActivateWithVoiceAboveLock" - ErrorAction SilentlyContinue
605
+ }
606
+
607
+ # Disable access to notifications from UWP apps
608
+ Function DisableUWPNotifications {
609
+ Write-Output " Disabling access to notifications from UWP apps..."
610
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
611
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
612
+ }
613
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessNotifications" - Type DWord - Value 2
614
+ }
615
+
616
+ # Enable access to notifications from UWP apps
617
+ Function EnableUWPNotifications {
618
+ Write-Output " Enabling access to notifications from UWP apps..."
619
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessNotifications" - ErrorAction SilentlyContinue
620
+ }
621
+
622
+ # Disable access to account info from UWP apps
623
+ Function DisableUWPAccountInfo {
624
+ Write-Output " Disabling access to account info from UWP apps..."
625
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
626
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
627
+ }
628
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessAccountInfo" - Type DWord - Value 2
629
+ }
630
+
631
+ # Enable access to account info from UWP apps
632
+ Function EnableUWPAccountInfo {
633
+ Write-Output " Enabling access to account info from UWP apps..."
634
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessAccountInfo" - ErrorAction SilentlyContinue
635
+ }
636
+
637
+ # Disable access to contacts from UWP apps
638
+ Function DisableUWPContacts {
639
+ Write-Output " Disabling access to contacts from UWP apps..."
640
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
641
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
642
+ }
643
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessContacts" - Type DWord - Value 2
644
+ }
645
+
646
+ # Enable access to contacts from UWP apps
647
+ Function EnableUWPContacts {
648
+ Write-Output " Enabling access to contacts from UWP apps..."
649
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessContacts" - ErrorAction SilentlyContinue
650
+ }
651
+
652
+ # Disable access to calendar from UWP apps
653
+ Function DisableUWPCalendar {
654
+ Write-Output " Disabling access to calendar from UWP apps..."
655
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
656
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
657
+ }
658
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessCalendar" - Type DWord - Value 2
659
+ }
660
+
661
+ # Enable access to calendar from UWP apps
662
+ Function EnableUWPCalendar {
663
+ Write-Output " Enabling access to calendar from UWP apps..."
664
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessCalendar" - ErrorAction SilentlyContinue
665
+ }
666
+
667
+ # Disable access to phone calls from UWP apps
668
+ Function DisableUWPPhoneCalls {
669
+ Write-Output " Disabling access to phone calls from UWP apps..."
670
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
671
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
672
+ }
673
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessPhone" - Type DWord - Value 2
674
+ }
675
+
676
+ # Enable access to phone calls from UWP apps
677
+ Function EnableUWPPhoneCalls {
678
+ Write-Output " Enabling access to phone calls from UWP apps..."
679
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessPhone" - ErrorAction SilentlyContinue
680
+ }
681
+
682
+ # Disable access to call history from UWP apps
683
+ Function DisableUWPCallHistory {
684
+ Write-Output " Disabling access to call history from UWP apps..."
685
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
686
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
687
+ }
688
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessCallHistory" - Type DWord - Value 2
689
+ }
690
+
691
+ # Enable access to call history from UWP apps
692
+ Function EnableUWPCallHistory {
693
+ Write-Output " Enabling access to call history from UWP apps..."
694
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessCallHistory" - ErrorAction SilentlyContinue
695
+ }
696
+
697
+ # Disable access to email from UWP apps
698
+ Function DisableUWPEmail {
699
+ Write-Output " Disabling access to email from UWP apps..."
700
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
701
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
702
+ }
703
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessEmail" - Type DWord - Value 2
704
+ }
705
+
706
+ # Enable access to email from UWP apps
707
+ Function EnableUWPEmail {
708
+ Write-Output " Enabling access to email from UWP apps..."
709
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessEmail" - ErrorAction SilentlyContinue
710
+ }
711
+
712
+ # Disable access to tasks from UWP apps
713
+ Function DisableUWPTasks {
714
+ Write-Output " Disabling access to tasks from UWP apps..."
715
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
716
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
717
+ }
718
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessTasks" - Type DWord - Value 2
719
+ }
720
+
721
+ # Enable access to tasks from UWP apps
722
+ Function EnableUWPTasks {
723
+ Write-Output " Enabling access to tasks from UWP apps..."
724
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessTasks" - ErrorAction SilentlyContinue
725
+ }
726
+
727
+ # Disable access to messaging (SMS, MMS) from UWP apps
728
+ Function DisableUWPMessaging {
729
+ Write-Output " Disabling access to messaging from UWP apps..."
730
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
731
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
732
+ }
733
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessMessaging" - Type DWord - Value 2
734
+ }
735
+
736
+ # Enable access to messaging from UWP apps
737
+ Function EnableUWPMessaging {
738
+ Write-Output " Enabling access to messaging from UWP apps..."
739
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessMessaging" - ErrorAction SilentlyContinue
740
+ }
741
+
742
+ # Disable access to radios (e.g. Bluetooth) from UWP apps
743
+ Function DisableUWPRadios {
744
+ Write-Output " Disabling access to radios from UWP apps..."
745
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
746
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
747
+ }
748
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessRadios" - Type DWord - Value 2
749
+ }
750
+
751
+ # Enable access to radios from UWP apps
752
+ Function EnableUWPRadios {
753
+ Write-Output " Enabling access to radios from UWP apps..."
754
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessRadios" - ErrorAction SilentlyContinue
755
+ }
756
+
757
+ # Disable access to other devices (unpaired, beacons, TVs etc.) from UWP apps
758
+ Function DisableUWPOtherDevices {
759
+ Write-Output " Disabling access to other devices from UWP apps..."
760
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
761
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
762
+ }
763
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsSyncWithDevices" - Type DWord - Value 2
764
+ }
765
+
766
+ # Enable access to other devices from UWP apps
767
+ Function EnableUWPOtherDevices {
768
+ Write-Output " Enabling access to other devices from UWP apps..."
769
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsSyncWithDevices" - ErrorAction SilentlyContinue
770
+ }
771
+
772
+ # Disable access to diagnostic information from UWP apps
773
+ Function DisableUWPDiagInfo {
774
+ Write-Output " Disabling access to diagnostic information from UWP apps..."
775
+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" )) {
776
+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Force | Out-Null
777
+ }
778
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsGetDiagnosticInfo" - Type DWord - Value 2
779
+ }
780
+
781
+ # Enable access to diagnostic information from UWP apps
782
+ Function EnableUWPDiagInfo {
783
+ Write-Output " Enabling access to diagnostic information from UWP apps..."
784
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsGetDiagnosticInfo" - ErrorAction SilentlyContinue
785
+ }
786
+
787
+ # Disable access to libraries and file system from UWP apps
788
+ Function DisableUWPFileSystem {
789
+ Write-Output " Disabling access to libraries and file system from UWP apps..."
790
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary" - Name " Value" - Type String - Value " Deny"
791
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary" - Name " Value" - Type String - Value " Deny"
792
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary" - Name " Value" - Type String - Value " Deny"
793
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess" - Name " Value" - Type String - Value " Deny"
794
+ }
795
+
796
+ # Enable access to libraries and file system from UWP apps
797
+ Function EnableUWPFileSystem {
798
+ Write-Output " Enabling access to libraries and file system from UWP apps..."
799
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary" - Name " Value" - Type String - Value " Allow"
800
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary" - Name " Value" - Type String - Value " Allow"
801
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary" - Name " Value" - Type String - Value " Allow"
802
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess" - Name " Value" - Type String - Value " Allow"
803
+ }
804
+
805
+ # Disable UWP apps swap file
806
+ # 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.
807
+ Function DisableUWPSwapFile {
808
+ Write-Output " Disabling UWP apps swap file..."
809
+ Set-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" - Name " SwapfileControl" - Type Dword - Value 0
810
+ }
811
+
812
+ # Enable UWP apps swap file
813
+ Function EnableUWPSwapFile {
814
+ Write-Output " Enabling UWP apps swap file..."
815
+ Remove-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" - Name " SwapfileControl" - ErrorAction SilentlyContinue
816
+ }
817
+
818
+ # #########
819
+ # endregion UWP Privacy Tweaks
820
+ # #########
821
+
822
+
823
+
581
824
# #########
582
825
# region Security Tweaks
583
826
# #########
@@ -1388,19 +1631,6 @@ Function EnableIndexing {
1388
1631
Start-Service " WSearch" - WarningAction SilentlyContinue
1389
1632
}
1390
1633
1391
- # Disable UWP apps swap file
1392
- # 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.
1393
- Function DisableSwapFile {
1394
- Write-Output " Disabling UWP apps swap file..."
1395
- Set-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" - Name " SwapfileControl" - Type Dword - Value 0
1396
- }
1397
-
1398
- # Enable UWP apps swap file
1399
- Function EnableSwapFile {
1400
- Write-Output " Enabling UWP apps swap file..."
1401
- Remove-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" - Name " SwapfileControl" - ErrorAction SilentlyContinue
1402
- }
1403
-
1404
1634
# Disable Recycle Bin - Files will be permanently deleted without placing into Recycle Bin
1405
1635
Function DisableRecycleBin {
1406
1636
Write-Output " Disabling Recycle Bin..."
0 commit comments