Advertisement
BaSs_HaXoR

And last but not least 1+.ps1 WIN10 privacy script

Jun 21st, 2018
739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # https://community.spiceworks.com/scripts/show/3977-windows-10-decrapifier-version-2?BHT-0792f281-fb57-4529-abe8-ae040a7d9d14.0
  2.  
  3. <#
  4. Decrapifier how-to:
  5. https://community.spiceworks.com/how_to/148624-how-to-clean-up-a-single-windows-10-machine-image-using-decrapifier
  6.  
  7. MDT Decrapifier how-to:
  8. https://community.spiceworks.com/how_to/150455-shoehorn-decrapifier-into-your-mdt-task
  9.  
  10. If you would still like the "less intense" version 1, it is available at the address below. It still works, but I am not updating it anymore, and it hasn't been tested after 1607.
  11. https://community.spiceworks.com/scripts/show/3298-windows-10-decrapifier-version-1
  12.  
  13. -------------------------------------------------------------------------------
  14.  
  15. PURPOSE: Create a clean, professional looking W10 experience. Changes some settings no longer available via GPO for Professional edition.
  16.  
  17. RESULT: You can end up with an experience similar to LTSB, and then some. Nice clean interface and much less bloat.
  18.  
  19. ***And please, let me know of any issues you find so I can fix them! Seemed to run very well in my tests.***
  20.  
  21. -------------------------------------------------------------------------------
  22.  
  23. UNDO:
  24. If you remove the store and want it back, the best (only?) way to fully undo this script is a repair install/in-place upgrade of Windows. From your desktop, insert/mount your W10 install media, and "upgrade" Windows to the same edition. Choose to keep your files. This will set Windows back to default but leave your profile.
  25.  
  26. -------------------------------------------------------------------------------
  27. INSTRUCTIONS:
  28.  
  29. See how to link above.
  30.  
  31. -------------------------------------------------------------------------------
  32. #>
  33.  
  34. #Windows 10 Decrapifier 2.0: ULTRA-DECRAPIFIER
  35. #By CSAND
  36. #March 16 2018
  37. #
  38. #
  39. #OFFICIAL DOWNLOAD:
  40. #https://community.spiceworks.com/scripts/show/3298-windows-10-decrapifier-v2
  41. #
  42. #
  43. #Join the Spiceworks Decrapifier community group on Spiceworks to get help or make suggestions!
  44. #https://community.spiceworks.com/user-groups/windows-decrapifier-group
  45. #
  46. #
  47. #***Please follow the how-tos below for best results!!! These are the only ways I suggest to run this script. Meant to be run on a new machine. Running from an existing user profile will give good, but incomplete results.***
  48. #
  49. #Single machine how-to:
  50. #https://community.spiceworks.com/how_to/148624-how-to-clean-up-a-single-windows-10-machine-image-using-decrapifier
  51. #
  52. #Basic MDT how-to:
  53. #https://community.spiceworks.com/how_to/150455-shoehorn-decrapifier-into-your-mdt-task
  54. #
  55. #WARNING: This script will alter Windows 10. The changes can be difficult to undo! It does exactly what it says, however I encourage you to research these changes beforehand.
  56. #         I described each section with comments, so please read first. The less heavy-handed original version of the Decrapifier is available.
  57. #         It's always a decent idea to backup your PC before running scripts like this.
  58. #
  59. #Decrapifier Version 1:
  60. #https://community.spiceworks.com/scripts/show/3977-windows-10-decrapifier-version-1
  61. #
  62. #PURPOSE: Eliminate much of the bloat that comes with Windows 10. By default - change a large amount of privacy settings in your favour. Remove built-in advertising, Cortana, OneDrive. Disable most data collection.
  63. #         Clean up the start menu for new user accounts.  Remove a bunch of pre-insalled apps, or all of them (including the store).  Create a clean, professional looking W10 experience.  Changes some settings no longer available
  64. #         via GPO for Professional edition.
  65. #
  66. #
  67. #
  68. #
  69. #***Switches! Customize your decrapification!***
  70. #
  71. #Switch         Function
  72. #---------------------------
  73. #No switches    Decrapifies current user account only. Leaves other user accounts alone. Still disables services and scheduled tasks. Removes all apps but Store, Photos, Sound Recorder, 3D Paint, and Calculator.
  74. #-allusers      Decrapifies the current user account, and the default user account.  Run on the first login to your new machine, and only decrapify once!
  75. #-allapps       Removes ALL apps including the store.  Use wisely!
  76. #-leavetasks    Leaves scheduled tasks alone.
  77. #-leaveservices Leaves services alone.
  78. #-clearstart    Applies a clean start menu with only the File Explorer, Snipping Tool, and Control Panel pinned.  Applies to all subsequent new users on the PC. Customize your pinned apps by editing the layout right in this script! (Find the ClearStartMenu function).
  79. #-appsonly      Only removes apps, doesn't touch privacy settings, services, and scheduled tasks. Cannot be used with -settingsonly switch. Can be used with all the others.
  80. #-settingsonly  Only adjusts privacy settings, services, and scheduled tasks.  Leaves apps.  Cannot be used with -appsonly switch.  Can be used with all others (-allapps won't do anything in that case, obviously).
  81. #
  82. #
  83. [cmdletbinding(DefaultParameterSetName="Decrapifier")]
  84. param (
  85.     [switch]$allusers,
  86.     [switch]$allapps,
  87.     [switch]$leavetasks,
  88.     [switch]$leaveservices,
  89.     [switch]$clearstart,
  90.     [Parameter(ParameterSetName="AppsOnly")]
  91.     [switch]$appsonly,
  92.     [Parameter(ParameterSetName="SettingsOnly")]
  93.     [switch]$settingsonly
  94.     )
  95.  
  96.  
  97. #Appx removal
  98. Function RemMostApps {
  99.     If ($allusers) {  
  100.         Write-Host "***Removing all apps and provisioned appx packages for this machine except Store, Photos, and Calculator...***"      
  101.         Get-AppxPackage -AllUsers | where-object {$_.name -notlike "*Store*" -and $_.name -notlike "*Calculator*" -and $_.name -notlike "*sticky*" -and $_.name -notlike "*Windows.Photos*" -and $_.name -notlike "*SoundRecorder*" -and $_.name -notlike "*MSPaint*"} | Remove-AppxPackage -erroraction silentlycontinue
  102.         Get-AppxPackage -AllUsers | where-object {$_.name -notlike "*Store*" -and $_.name -notlike "*Calculator*" -and $_.name -notlike "*sticky*" -and $_.name -notlike "*Windows.Photos*" -and $_.name -notlike "*SoundRecorder*" -and $_.name -notlike "*MSPaint*"} | Remove-AppxPackage -erroraction silentlycontinue
  103.         Get-AppxProvisionedPackage -online | where-object {$_.displayname -notlike "*Store*" -and $_.displayname -notlike "*Calculator*" -and $_.displayname -notlike "*sticky*" -and $_.displayname -notlike "*Windows.Photos*" -and $_.displayname -notlike "*SoundRecorder*"  -and $_.displayname -notlike "*MSPaint*"} | Remove-AppxProvisionedPackage -online -erroraction silentlycontinue
  104.        
  105. }    Else {
  106.         Write-Host "***Removing all apps for the current user, except Store, Photos and Calculator...***"                
  107.         Get-AppxPackage | where-object {$_.name -notlike "*Store*" -and $_.name -notlike "*Calculator*" -and $_.name -notlike "*sticky*" -and $_.name -notlike "*Windows.Photos*" -and $_.name -notlike "*SoundRecorder*" -and $_.name -notlike "*MSPaint*"} | Remove-AppxPackage -erroraction silentlycontinue
  108.         Get-AppxPackage | where-object {$_.name -notlike "*Store*" -and $_.name -notlike "*Calculator*" -and $_.name -notlike "*sticky*" -and $_.name -notlike "*Windows.Photos*" -and $_.name -notlike "*SoundRecorder*" -and $_.name -notlike "*MSPaint*"} | Remove-AppxPackage -erroraction silentlycontinue
  109. }        
  110. }
  111.    
  112. Function RemAllApps {
  113.     If ($allusers) {
  114.         Write-Host "***Removing all apps and provisioned appx packages for this machine...***"
  115.         Get-AppxPackage -AllUsers | Remove-AppxPackage -erroraction silentlycontinue
  116.         Get-AppxPackage -AllUsers | Remove-AppxPackage -erroraction silentlycontinue
  117.         Get-AppxProvisionedPackage -online | Remove-AppxProvisionedPackage -online -erroraction silentlycontinue
  118.  
  119. }    Else {
  120.         Write-Host "***Removing all apps for the current user...***"
  121.         Get-Appxpackage | Remove-Appxpackage -erroraction silentlycontinue
  122.         Get-Appxpackage | Remove-Appxpackage -erroraction silentlycontinue
  123. }
  124. }
  125.  
  126.  
  127. #Scheduled task removal
  128. #Tasks: Send Smartscreen filtering data to MS, CEIP options that used to be able to be disabled earlier Windows (now mandatory) - functions self explanatory based on the name
  129. #       Send error reports in the queue to MS, installation of ads, cloud content, etc
  130. Function RemTasks {
  131.     If ($leavetasks) {
  132.         Write-Host "***Leavetasks switch set - leaving scheduled tasks intact...***"
  133.  
  134. }    Else {
  135.         Write-Host "***Disabling some unecessary scheduled tasks...***"
  136.         Get-Scheduledtask "SmartScreenSpecific","Microsoft Compatibility Appraiser","Consolidator","KernelCeipTask","UsbCeip","Microsoft-Windows-DiskDiagnosticDataCollector", "GatherNetworkInfo","QueueReporting" -erroraction silentlycontinue | Disable-scheduledtask
  137. }
  138. }
  139.  
  140. #Disable services
  141. Function DisService {
  142.     If ($leaveservices) {
  143.         Write-Host "***Leaveservices switch set - leaving services enabled...***"
  144.  
  145. }    Else {
  146.         Write-Host "***Stopping and disabling diagnostics tracking services, Onesync service (syncs contacts, mail, etc, needed for OneDrive), various Xbox services, and Windows Media Player network sharing (you can turn this back on if you share your media libraries with WMP)...***"
  147.         #Diagnostics tracking and xbox services
  148.         Get-Service Diagtrack,OneSyncSvc,XblAuthManager,XblGameSave,XboxNetApiSvc,WMPNetworkSvc -erroraction silentlycontinue | stop-service -passthru | set-service -startuptype disabled
  149.         #WAP Push Message Routing  NOTE Sysprep w/ Generalize WILL FAIL if you disable the DmwApPushService.  Commented out by default.
  150.         #Get-Service DmwApPushService -erroraction silentlycontinue | stop-service -passthru | set-service -startuptype disabled
  151. }
  152. }
  153.  
  154.        
  155. #Registry change functions
  156.  
  157. #Load default user hive
  158. Function loaddefaulthive {
  159.     reg load "$reglocation" c:\users\default\ntuser.dat
  160. }
  161. #unload default user hive
  162. Function unloaddefaulthive {
  163.     [gc]::collect()
  164.     reg unload "$reglocation"
  165. }
  166.  
  167. Function RegSetCUOnly {
  168.    
  169.     #Setting Windows 10 privacy options user settings, these are all available from the settings menu
  170.     #Can apps access...
  171.     #Location
  172.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Permissions\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /T REG_DWORD /V "SensorPermissionState" /D 0 /F
  173.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /T REG_SZ /V "Value" /D DENY /F
  174.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{E6AD100E-5F4E-44CD-BE0F-2265D88D14F5}" /T REG_SZ /V "Value" /D DENY /F
  175.     #Camera
  176.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{E5323777-F976-4f5b-9B55-B94699C46E44}" /T REG_SZ /V "Value" /D DENY /F
  177.     #Calendar
  178.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{D89823BA-7180-4B81-B50C-7E471E6121A3}" /T REG_SZ /V "Value" /D DENY /F
  179.     #Contacts
  180.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{7D7E8402-7C54-4821-A34E-AEEFD62DED93}" /T REG_SZ /V "Value" /D DENY /F
  181.     #Notifications
  182.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{52079E78-A92B-413F-B213-E8FE35712E72}" /T REG_SZ /V "Value" /D DENY /F
  183.     #Microphone
  184.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{2EEF81BE-33FA-4800-9670-1CD474972C3F}" /T REG_SZ /V "Value" /D DENY /F
  185.     #Account Info
  186.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{C1D23ACC-752B-43E5-8448-8D0E519CD6D6}" /T REG_SZ /V "Value" /D DENY /F
  187.     #Call history
  188.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{8BC668CF-7728-45BD-93F8-CF2B3B41D7AB}" /T REG_SZ /V "Value" /D DENY /F
  189.     #Email, may break the Mail app?
  190.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{9231CB4C-BF57-4AF3-8C55-FDA7BFCC04C5}" /T REG_SZ /V "Value" /D DENY /F
  191.     #TXT/MMS
  192.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{992AFA70-6F47-4148-B3E9-3003349C1548}" /T REG_SZ /V "Value" /D DENY /F
  193.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{21157C1F-2651-4CC1-90CA-1F28B02263F6}" /T REG_SZ /V "Value" /D DENY /F
  194.     #Radios
  195.     Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{A8804298-2D5F-42E3-9531-9C8C39EB29CE}" /T REG_SZ /V "Value" /D DENY /F
  196. }
  197.  
  198. #Set default user settings
  199. Function RegSetUser {
  200.     #Disabling Suggested Apps, Feedback, Lockscreen Spotlight, and File Explorer ads
  201.     #Start menu suggestions
  202.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SystemPaneSuggestionsEnabled" /D 0 /F
  203.     #Lockscreen suggestions, rotating pictures
  204.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SoftLandingEnabled" /D 0 /F
  205.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "RotatingLockScreenEnabled" /D 0 /F
  206.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "RotatingLockScreenOverlayEnabled" /D 0 /F
  207.     #Preinstalled apps, Minecraft Twitter etc all that - Enterprise only it seems
  208.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "PreInstalledAppsEnabled" /D 0 /F
  209.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "PreInstalledAppsEverEnabled" /D 0 /F
  210.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "OEMPreInstalledAppsEnabled" /D 0 /F
  211.     #Stop MS shoehorning apps quietly into your profile
  212.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SilentInstalledAppsEnabled" /D 0 /F
  213.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "ContentDeliveryAllowed" /D 0 /F
  214.     #1709, doesn't work - Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SubscribedContentEnabled" /D 0 /F
  215.     #Ads in File Explorer
  216.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /T REG_DWORD /V "ShowSyncProviderNotifications" /D 0 /F
  217.    
  218.     #Disabling auto update and download of Windows Store Apps - enable if you are not using the store
  219.     #Reg Add "$reglocation\SOFTWARE\Policies\Microsoft\WindowsStore" /T REG_DWORD /V "AutoDownload" /D 2 /F
  220.    
  221.     #Disabling Onedrive startup run user settings
  222.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /T REG_BINARY /V "OneDrive" /D 0300000021B9DEB396D7D001 /F
  223.        
  224.     #Let websites provide local content by accessing language list
  225.     Reg Add "$reglocation\Control Panel\International\User Profile" /T REG_DWORD /V "HttpAcceptLanguageOptOut" /D 1 /F
  226.    
  227.     #Let apps share and sync non-explicitly paired wireless devices over uPnP
  228.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\LooselyCoupled" /T REG_SZ /V "Value" /D DENY /F
  229.    
  230.     #Don't ask for feedback
  231.     Reg Add "$reglocation\SOFTWARE\Microsoft\Siuf\Rules" /T REG_DWORD /V "NumberOfSIUFInPeriod" /D 0 /F
  232.     Reg Add "$reglocation\SOFTWARE\Microsoft\Siuf\Rules" /T REG_DWORD /V "PeriodInNanoSeconds" /D 0 /F
  233.    
  234.     #Stopping Cortana/Microsoft from getting to know you"
  235.     Reg Add "$reglocation\SOFTWARE\Microsoft\Personalization\Settings" /T REG_DWORD /V "AcceptedPrivacyPolicy" /D 0 /F
  236.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Language" /T REG_DWORD /V "Enabled" /D 0 /F
  237.     Reg Add "$reglocation\SOFTWARE\Microsoft\InputPersonalization" /T REG_DWORD /V "RestrictImplicitTextCollection" /D 1 /F
  238.     Reg Add "$reglocation\SOFTWARE\Microsoft\InputPersonalization" /T REG_DWORD /V "RestrictImplicitInkCollection" /D 1 /F
  239.     Reg Add "$reglocation\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" /T REG_DWORD /V "HarvestContacts" /D 0 /F
  240.     Reg Add "$reglocation\SOFTWARE\Microsoft\Input\TIPC" /T REG_DWORD /V "Enabled" /D 0 /F
  241.    
  242.     #Disabling Cortana and Bing search user settings"
  243.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "CortanaEnabled" /D 0 /F
  244.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "BingSearchEnabled" /D 0 /F
  245.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "DeviceHistoryEnabled" /D 0 /F
  246.    
  247.     #Below takes search bar off the taskbar, personal preference
  248.     #Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "SearchboxTaskbarMode" /D 0 /F
  249.    
  250.     #Stop Cortana from remembering history"
  251.     Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "HistoryViewEnabled" /D 0 /F
  252. }
  253.  
  254. #Set local machine policies    
  255. Function RegSetMachine {
  256.  
  257.     #--Local GP settings--
  258.     #Can be adjusted in GPedit.msc in Pro+ editions.
  259.     #Local Policy/Computer Config/Admin Templates/Windows Components           
  260.     #/App Privacy          
  261.     #Account Info          
  262.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessAccountInfo"/D 2 /F
  263.     #Calendar          
  264.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessCalendar"/D 2 /F
  265.     #Call History          
  266.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessCallHistory" /D 2 /F
  267.     #Camera        
  268.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessCamera" /D 2 /F
  269.     #Contacts          
  270.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessContacts" /D 2 /F
  271.     #Email         
  272.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessEmail" /D 2 /F
  273.     #Location          
  274.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessLocation" /D 2 /F
  275.     #Messaging         
  276.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessMessaging" /D 2 /F
  277.     #Microphone        
  278.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessMicrophone" /D 2 /F
  279.     #Motion        
  280.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessMotion" /D 2 /F
  281.     #Notifications         
  282.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessNotifications" /D 2 /F
  283.     #Make Phone Calls          
  284.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessPhone" /D 2 /F
  285.     #Radios        
  286.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessRadios" /D 2 /F
  287.     #Access trusted devices        
  288.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessTrustedDevices" /D 2 /F
  289.     #Sync with devices         
  290.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsSyncWithDevices" /D 2 /F
  291.  
  292.     #/Application Compatibility
  293.     #Turn off Application Telemetry        
  294.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /T REG_DWORD /V "AITEnable" /D 0 /F           
  295.     #Turn off inventory collector          
  296.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /T REG_DWORD /V "DisableInventory" /D 1 /F
  297.     #Turn off steps recorder
  298.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /T REG_DWORD /V "DisableUAR" /D 1 /F
  299.  
  300.     #/Cloud Content        
  301.     #Do not show Windows Tips          
  302.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /T REG_DWORD /V "DisableSoftLanding" /D 1 /F
  303.     #Turn off Consumer Experiences         
  304.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /T REG_DWORD /V "DisableWindowsConsumerFeatures" /D 1 /F
  305.    
  306.     #/Data Collection and Preview Builds           
  307.     #Set Telemetry to basic (switches to 1:basic for W10Pro and lower, disabled altogether by disabling service anyways)           
  308.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /T REG_DWORD /V "AllowTelemetry" /D 0 /F
  309.     #Disable pre-release features and settings         
  310.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /T REG_DWORD /V "EnableConfigFlighting" /D 0 /F
  311.     #Do not show feedback notifications        
  312.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /T REG_DWORD /V "DoNotShowFeedbackNotifications" /D 1 /F
  313.  
  314.     #/Delivery optimization        
  315.     #Disable DO; set to 1 to allow DO over LAN only        
  316.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" /T REG_DWORD /V "DODownloadMode" /D 0 /F
  317.     #Non-GPO DO settings, may be redundant after previous.
  318.     #Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /T REG_DWORD /V "DownloadMode" /D 0 /F
  319.     #Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /T REG_DWORD /V "DODownloadMode" /D 0 /F
  320.        
  321.     #/Location and Sensors         
  322.     #Turn off location         
  323.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" /T REG_DWORD /V "DisableLocation" /D 1 /F
  324.     #Turn off Sensors          
  325.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" /T REG_DWORD /V "DisableSensors" /D 1 /F
  326.  
  327.     #/Microsoft Edge           
  328.     #Always send do not track          
  329.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main" /T REG_DWORD /V "DoNotTrack" /D 1 /F
  330.  
  331.     #/OneDrive         
  332.     #Prevent usage of OneDrive         
  333.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /T REG_DWORD /V "DisableFileSyncNGSC" /D 1 /F
  334.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /T REG_DWORD /V "DisableFileSync" /D 1 /F
  335.            
  336.     #/Search           
  337.     #Disallow Cortana          
  338.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /T REG_DWORD /V "AllowCortana" /D 0 /F
  339.     #Disallow Cortana on lock screen           
  340.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /T REG_DWORD /V "AllowCortanaAboveLock" /D 0 /F
  341.     #Disallow web search from desktop search           
  342.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /T REG_DWORD /V "DisableWebSearch" /D 1 /F
  343.     #Don't search the web or display web results in search         
  344.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /T REG_DWORD /V "ConnectedSearchUseWeb" /D 0 /F
  345.  
  346.     #/Store        
  347.     #Turn off Automatic download/install of app updates - comment in if you aren't using the store     
  348.     #Reg Add    "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /T REG_DWORD /V "AutoDownload" /D 2 /F
  349.                
  350.     #Disable all apps from store, left disabled by default         
  351.     #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /T REG_DWORD /V "DisableStoreApps" /D 1 /F
  352.                
  353.     #Turn off Store, left disabled by default          
  354.     #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /T REG_DWORD /V "RemoveWindowsStore" /D 1 /F
  355.  
  356.     #/Sync your settings           
  357.     #Do not sync (anything)        
  358.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /T REG_DWORD /V "DisableSettingSync" /D 2 /F
  359.     #Disallow users to override this
  360.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /T REG_DWORD /V "DisableSettingSyncUserOverride" /D 1 /F
  361.  
  362.     #/Windows Update           
  363.     #Turn off featured software notifications through WU (basically ads)           
  364.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /T REG_DWORD /V "EnableFeaturedSoftware" /D 0 /F
  365.  
  366.     #--Non Local-GP Settings--
  367.     #Disabling advertising info and device metadata collection for this machine
  368.     Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /T REG_DWORD /V "Enabled" /D 0 /F
  369.     Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" /V "PreventDeviceMetadataFromNetwork" /T REG_DWORD /D 1 /F
  370.  
  371.     #Prevent apps on other devices from opening apps on this one
  372.     Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SmartGlass" /T REG_DWORD /V "UserAuthPolicy " /D 0 /F
  373.    
  374.     #Prevent using sign-in info to automatically finish setting up after an update
  375.     Reg Add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /T REG_DWORD /V "ARSOUserConsent" /D 2 /F
  376.    
  377.     #Disable Malicious Software Removal Tool through WU, and CEIP.  Left MRT enabled by default.
  378.     #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\MRT" /T REG_DWORD /V "DontOfferThroughWUAU" /D 1 /F
  379.     Reg Add "HKLM\SOFTWARE\Policies\Microsoft\SQMClient\Windows" /T REG_DWORD /V "CEIPEnable" /D 0 /F
  380.    
  381.     #Filter web content through smartscreen. Left enabled by default.
  382.     #Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" /T REG_DWORD /V "EnableWebContentEvaluation" /D 0 /F
  383.    
  384.     #User Config/Admin Templates/Windows Components (work in progress, don't seem to work)     
  385.     #/Cloud Content        
  386.     #Turn off spotlight on lock screen         
  387.     #Reg Add    "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy Objects\{8F5431C8-CECD-4977-92D5-0C52E9705084}User\Software\Policies\Microsoft\Windows\CloudContent" /T REG_DWORD /V "ConfigureWindowsSpotlight" /D 2 /F
  388.     #Reg Add    "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy Objects\{8F5431C8-CECD-4977-92D5-0C52E9705084}User\Software\Policies\Microsoft\Windows\CloudContent" /T REG_DWORD /V "IncludeEnterpriseSpotlight" /D 0 /F
  389.                
  390.     #Do not suggest 3rd party content          
  391.     #Reg Add    "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy Objects\{8F5431C8-CECD-4977-92D5-0C52E9705084}User\Software\Policies\Microsoft\Windows\CloudContent" /T REG_DWORD /V "DisableThirdPartySuggestions" /D 1 /F
  392.                
  393.     #Turn off all spotlight features           
  394.     #Reg Add    "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy Objects\{8F5431C8-CECD-4977-92D5-0C52E9705084}User\Software\Policies\Microsoft\Windows\CloudContent" /T REG_DWORD /V "DisableWindowsSpotlightFeatures" /D 1 /F  
  395. }          
  396.  
  397. #Call correct registry changing functions
  398. Function RegChange {
  399.      If ($allusers) {
  400.         Write-Host "***Setting registry for current and default user, and policies for local machine...***"
  401.         regsetCUonly
  402.         $reglocation = "HKCU"
  403.         regsetuser
  404.         $reglocation = "HKLM\AllProfile"
  405.         loaddefaulthive; regsetuser; unloaddefaulthive
  406.         $reglocation = $null
  407.         regsetmachine
  408.         Write-Host "***Registry set current user and default user, and policies set for local machine!***"
  409.  
  410. }    Else {
  411.         Write-Host "***Allusers switch not set - setting registry for current user only, ignoring local machine settings/polices...***"
  412.         regsetCUonly
  413.         $reglocation = "HKCU"
  414.         regsetuser
  415.         Write-Host "***Allusers switch not set - registry set for current user only! Machine settings/policies untouched.***"
  416. }
  417. }
  418.  
  419. #Clean up the default start menu    
  420. Function ClearStartMenu {
  421.      If ($clearstart) {
  422.         Write-Host "***Setting clean start menu for new profiles...***"
  423.         $startlayoutstr = @"
  424. <LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
  425.  <LayoutOptions StartTileGroupCellWidth="6" />
  426.  <DefaultLayoutOverride>
  427.    <StartLayoutCollection>
  428.      <defaultlayout:StartLayout GroupCellWidth="6" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout">
  429.        <start:Group Name="" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
  430.          <start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk" />
  431.          <start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Snipping Tool.lnk" />
  432.           <start:DesktopApplicationTile Size="2x2" Column="0" Row="2" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\Control Panel.lnk" />
  433.        </start:Group>
  434.      </defaultlayout:StartLayout>
  435.    </StartLayoutCollection>
  436.  </DefaultLayoutOverride>
  437. </LayoutModificationTemplate>
  438. "@
  439.         add-content $Env:TEMP\startlayout.xml $startlayoutstr
  440.         import-startlayout -layoutpath $Env:TEMP\startlayout.xml -mountpath $Env:SYSTEMDRIVE\
  441.         remove-item $Env:TEMP\startlayout.xml
  442.  
  443. }    Else {
  444.         Write-Host "***Clearstart switch not present - menu tiles left untouched.***"
  445. }
  446. }
  447.  
  448.  
  449. #Goodbye Message Function
  450.  
  451. Function Goodbye {
  452.     Write-Host "*******Decrapification complete.*******"
  453.     Write-Host "*******Remember to set your execution policy back!  Set-Executionpolicy restricted is the Windows 10 default.*******"
  454.     Write-Host "*******Reboot your computer now!*******"
  455.        
  456. }
  457.  
  458. #Decrapify based on allapps switch, and settingsonly or appsonly switches
  459.  
  460. Write-Host "******Decrapifying Windows 10...******"
  461. If ($appsonly) {
  462.         If ($allapps) {
  463.             RemAllApps
  464.             ClearStartMenu
  465.             Goodbye
  466.  
  467. }        Else {
  468.             RemMostApps
  469.             ClearStartMenu
  470.             Goodbye
  471. }
  472.  
  473. }Elseif ($settingsonly) {
  474.          Remtasks
  475.          DisService
  476.          RegChange
  477.          ClearStartMenu
  478.          Goodbye
  479.  
  480. }Else {
  481.         If ($allapps) {
  482.             RemAllApps
  483.             Remtasks
  484.             DisService
  485.             RegChange
  486.             ClearStartMenu
  487.             Goodbye
  488.  
  489. }        Else {
  490.             RemMostApps
  491.             Remtasks
  492.             DisService
  493.             RegChange
  494.             ClearStartMenu
  495.             Goodbye
  496. }
  497. }
  498.  
  499. ###################################################################################################################
  500. # credits to EVISU for showing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement