Guest User

Untitled

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