Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.61 KB | None | 0 0
  1. #Windows 10 Decrapifier 1803/1809
  2. #By CSAND
  3. #June 21 2019
  4. #
  5. #
  6. #PURPOSE: Eliminate much of the bloat that comes with Windows 10. Change many privacy settings to be off by default. Remove built-in advertising, Cortana, OneDrive, Cortana stuff (all optional). Disable some data collection.
  7. # Clean up the start menu for new user accounts. Remove a bunch of pre-installed apps, or all of them (including the store). Create a more professional looking W10 experience. Changes some settings no longer
  8. # available via GPO for Professional edition.
  9. #
  10. #DISCLAIMER: Most of the changes are easily undone, but some like removing the store are difficult to undo. I encourage you to research these changes beforehand, and read through the script.
  11. # Each section is described with comments, to make it easier to see what's going on.
  12. #
  13. #
  14. #INSTRUCTIONS: For best results use the following how-tos. Running from an existing profile on an "in-use" machine won't affect any already-existing user profiles and won't give the best results.
  15. # Read through the script to see what is disabled, and comment out anything you want to keep. By default a transcript is saved at SYSTEMDRIVE\WindowsDCtranscript.txt.
  16. #
  17. #Single machine how-to:
  18. #https://community.spiceworks.com/how_to/148624-how-to-clean-up-a-single-windows-10-machine-image-using-decrapifier
  19. #
  20. #Basic MDT how-to:
  21. #https://community.spiceworks.com/how_to/150455-shoehorn-decrapifier-into-your-mdt-task
  22. #
  23. #
  24. #Join the Spiceworks Decrapifier community group on Spiceworks!
  25. #https://community.spiceworks.com/user-groups/windows-decrapifier-group
  26. #
  27. #Common questions/issues:
  28. #https://community.spiceworks.com/topic/2149611-common-questions-and-problems?page=1#entry-7850320
  29. #
  30. #
  31. #OFFICIAL DOWNLOAD:
  32. #https://community.spiceworks.com/scripts/show/4378-windows-10-decrapifier-1803
  33. #This is the only place I post any updates to this script.
  34. #
  35. #Changelog:
  36. #https://community.spiceworks.com/topic/2162951-changelog
  37. #
  38. #Previous versions:
  39. #https://community.spiceworks.com/scripts/show/3977-windows-10-decrapifier-1709
  40. #https://community.spiceworks.com/scripts/show/3298-windows-10-decrapifier-version-1
  41. #
  42. #
  43. #
  44. #***Switches***
  45. #
  46. #Switch Function
  47. #---------------------------
  48. #No switches Disables unnecessary services and scheduled tasks. Removes all UWP apps except for some useful ones. Disables Cortana, OneDrive, restricts default privacy settings and cleans up the default start menu.
  49. #-AllApps Removes ALL apps including the store. Make sure this is what you want before you do it. It can be tough to get the store back. Seriously, don't do this unless you are 100% certain.
  50. #-LeaveTasks Leaves scheduled tasks alone.
  51. #-LeaveServices Leaves services alone.
  52. #-AppAccess By default this script will restrict almost all the permissions in Settings -> Privacy. This will prevent that from happening.
  53. #-ClearStart Empties the start menu completely leaving you with just the apps list.
  54. #-OneDrive Leaves OneDrive and Onedrive for Business fully functional.
  55. #-Tablet Use this for tablets or 2-in-1s to leave location and sensors enabled.
  56. #-Cortana Leave Cortana and web enabled search intact... if that's what you really want.
  57. #-Xbox Leave xBox apps and related items.
  58. #-NoLog Don't copy transcript to systemdrive\WindowsDCtranscript.txt.
  59. #-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.
  60. #-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).
  61.  
  62. [cmdletbinding(DefaultParameterSetName="Decrapifier")]
  63. param (
  64. [switch]$AllApps,
  65. [switch]$LeaveTasks,
  66. [switch]$LeaveServices,
  67. [switch]$AppAccess,
  68. [switch]$OneDrive,
  69. [switch]$Xbox,
  70. [switch]$Tablet,
  71. [switch]$Cortana,
  72. [switch]$ClearStart,
  73. [switch]$NoLog,
  74. [Parameter(ParameterSetName="AppsOnly")]
  75. [switch]$AppsOnly,
  76. [Parameter(ParameterSetName="SettingsOnly")]
  77. [switch]$SettingsOnly
  78. )
  79.  
  80. #------USER EDITABLE VARIABLES - change these to your tastes!------
  81.  
  82. #Apps to keep. Wildcard is implied so try to be specific enough to not overlap with apps you do want removed.
  83. #Make sure not begin or end with a | (vertical line) ex: "app|app2" - good. "|app|app2|" - bad.
  84.  
  85. $GoodApps = "store|calculator|sticky|windows.photos|soundrecorder|mspaint|screensketch"
  86.  
  87. #Start Menu XML. If you run the script without -ClearStart, the XML below will be used for a custom start layout. By default it just leaves File Explorer, classic Control Panel, and Snipping Tool tiles.
  88. #Place your XML like so:
  89. # $StartLayourStr = @"
  90. # <**YOUR START LAYOUT XML**>
  91. # "@
  92.  
  93. $StartLayoutStr = @"
  94. <LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
  95. <LayoutOptions StartTileGroupCellWidth="6" />
  96. <DefaultLayoutOverride>
  97. <StartLayoutCollection>
  98. <defaultlayout:StartLayout GroupCellWidth="6" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout">
  99. <start:Group Name="" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
  100. <start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk" />
  101. <start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Snipping Tool.lnk" />
  102. <start:DesktopApplicationTile Size="2x2" Column="0" Row="2" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\Control Panel.lnk" />
  103. </start:Group>
  104. </defaultlayout:StartLayout>
  105. </StartLayoutCollection>
  106. </DefaultLayoutOverride>
  107. </LayoutModificationTemplate>
  108. "@
  109.  
  110. #------End editable variables------
  111.  
  112.  
  113. #---Functions---
  114.  
  115. #Appx removal
  116. #Removes all apps or some apps depending on switches used.
  117.  
  118. Function RemoveApps {
  119. #SafeApps contains apps that shouldn't be removed, or just can't and cause errors
  120. $SafeApps = "AAD.brokerplugin|accountscontrol|apprep.chxapp|assignedaccess|asynctext|bioenrollment|capturepicker|cloudexperience|contentdelivery|desktopappinstaller|ecapp|getstarted|immersivecontrolpanel|lockapp|net.native|oobenet|parentalcontrols|PPIProjection|sechealth|secureas|shellexperience|vclibs|xaml|XGpuEject"
  121. If ($Xbox) {
  122. $SafeApps = "$SafeApps|Xbox"
  123. }
  124.  
  125. If ($Allapps) {
  126. $RemoveApps = Get-AppxPackage -allusers | where-object {$_.name -notmatch $SafeApps}
  127. $RemovePrApps = Get-AppxProvisionedPackage -online | where-object {$_.displayname -notmatch $SafeApps}
  128. ForEach ($RemovedApp in $RemoveApps) {
  129. Write-Host Removing app package: $RemovedApp.name
  130. Remove-AppxPackage -package $RemovedApp -erroraction silentlycontinue
  131.  
  132. } ForEach ($RemovedPrApp in $RemovePrApps) {
  133. Write-Host Removing provisioned app $RemovedPrApp.displayname
  134. Remove-AppxProvisionedPackage -online -packagename $RemovedPrApp.packagename -erroraction silentlycontinue
  135.  
  136. }
  137. } Else {
  138. $SafeApps = "$SafeApps|$GoodApps"
  139. $RemoveApps = Get-AppxPackage -allusers | where-object {$_.name -notmatch $SafeApps}
  140. $RemovePrApps = Get-AppxProvisionedPackage -online | where-object {$_.displayname -notmatch $SafeApps}
  141. ForEach ($RemovedApp in $RemoveApps) {
  142. Write-Host Removing app package: $RemovedApp.name
  143. Remove-AppxPackage -package $RemovedApp -erroraction silentlycontinue
  144.  
  145. } ForEach ($RemovedPrApp in $RemovePrApps) {
  146. Write-Host Removing provisioned app $RemovedPrApp.displayname
  147. Remove-AppxProvisionedPackage -online -packagename $RemovedPrApp.packagename -erroraction silentlycontinue
  148.  
  149. }
  150. }
  151. } #End Function RemoveApps
  152.  
  153.  
  154.  
  155. #If ($AllApps) {
  156. # Write-Host "***Removing all apps and provisioned appx packages for this machine...***"
  157. #2 passes intentional.
  158. #Get-AppxPackage -allusers | where-object {$_.name -notmatch $SafeApps} | Remove-AppxPackage -erroraction silentlycontinue
  159. # Get-AppxPackage -allusers | where-object {$_.name -notmatch $SafeApps} | Remove-AppxPackage -erroraction silentlycontinue
  160. # Get-AppxProvisionedPackage -online | where-object {$_.displayname -notmatch $SafeApps} | Remove-AppxProvisionedPackage -online -erroraction silentlycontinue
  161.  
  162. #} Else {
  163. #$SafeApps = "$SafeApps|$GoodApps"
  164. #Write-Host "***Removing many apps and provisioned appx packages for this machine...***"
  165. #2 passes intentional.
  166. #Get-AppxPackage -allusers | where-object {$_.name -notmatch $SafeApps} | Remove-AppxPackage -erroraction silentlycontinue
  167. #Get-AppxPackage -allusers | where-object {$_.name -notmatch $SafeApps} | Remove-AppxPackage -erroraction silentlycontinue
  168. #Get-AppxProvisionedPackage -online | where-object {$_.displayname -notmatch $SafeApps} | Remove-AppxProvisionedPackage -online -erroraction silentlycontinue
  169. #}
  170.  
  171.  
  172. #Disable scheduled tasks
  173. #Tasks: Various CEIP and information gathering/sending tasks.
  174. Function DisableTasks {
  175. If ($LeaveTasks) {
  176. Write-Host "***Leavetasks switch set - leaving scheduled tasks alone...***"
  177. } Else {
  178. Write-Host "***Disabling some unecessary scheduled tasks...***"
  179. Get-Scheduledtask "Microsoft Compatibility Appraiser","ProgramDataUpdater","Consolidator","KernelCeipTask","UsbCeip","Microsoft-Windows-DiskDiagnosticDataCollector", "GatherNetworkInfo","QueueReporting" -erroraction silentlycontinue | Disable-scheduledtask
  180. }
  181. }
  182.  
  183.  
  184. #Disable services
  185. Function DisableServices {
  186. If ($LeaveServices) {
  187. Write-Host "***Leaveservices switch set - leaving services alone...***"
  188. } Else {
  189. Write-Host "***Stopping and disabling some services...***"
  190. #Diagnostics tracking WMP Network Sharing
  191. Get-Service Diagtrack,WMPNetworkSvc -erroraction silentlycontinue | stop-service -passthru | set-service -startuptype disabled
  192. #WAP Push Message Routing NOTE Sysprep w/ Generalize WILL FAIL if you disable the DmwApPushService. Commented out by default.
  193. #Get-Service DmwApPushService -erroraction silentlycontinue | stop-service -passthru | set-service -startuptype disabled
  194. #Disable OneSync service - Used to sync various apps and settings if you enable that (contacts, etc). Commented out by default to not break functionality.
  195. #Get-Service OneSyncSvc | stop-service -passthru | set-service -startuptype disabled
  196.  
  197. #xBox services
  198. If ($Xbox){
  199. } Else {
  200. #Disable xBox services - "xBox Game Monitoring Service" - XBGM - Can't be disabled (access denied)
  201. Get-Service XblAuthManager,XblGameSave,XboxNetApiSvc -erroraction silentlycontinue | stop-service -passthru | set-service -startuptype disabled
  202. }
  203. }
  204. }
  205.  
  206.  
  207. #Registry change functions
  208. #Load default user hive
  209. Function loaddefaulthive {
  210. $matjazp72 = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' Default).Default
  211. reg load "$reglocation" $matjazp72\ntuser.dat
  212. }
  213.  
  214.  
  215. #Unload default user hive
  216. Function unloaddefaulthive {
  217. [gc]::collect()
  218. reg unload "$reglocation"
  219. }
  220.  
  221.  
  222. #Cycle registry locations - 1st pass HKCU, 2nd pass default NTUSER.dat
  223. Function RegChange {
  224. Write-Host "***Applying registry items to HKCU...***"
  225. $reglocation = "HKCU"
  226. regsetuser
  227. $reglocation = "HKLM\AllProfile"
  228. Write-Host "***Applying registry items to default NTUSER.DAT...***"
  229. loaddefaulthive; regsetuser; unloaddefaulthive
  230. $reglocation = $null
  231. Write-Host "***Applying registry items to HKLM...***"
  232. regsetmachine
  233. Write-Host "***Registry set current user and default user, and policies set for local machine!***"
  234. }
  235.  
  236.  
  237. #Set current and default user registry settings
  238. Function RegSetUser {
  239. #Start menu suggestions
  240. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SystemPaneSuggestionsEnabled" /D 0 /F
  241. #Show suggested content in settings
  242. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SubscribedContent-338393Enabled" /D 0 /F
  243. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SubscribedContent-353694Enabled" /D 0 /F
  244. #Show suggestions occasionally
  245. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SubscribedContent-338388Enabled" /D 0 /F
  246. #Multitasking - Show suggestions in timeline
  247. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SubscribedContent-353698Enabled" /D 0 /F
  248. #Lockscreen suggestions, rotating pictures
  249. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SoftLandingEnabled" /D 0 /F
  250. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "RotatingLockScreenEnabled" /D 0 /F
  251. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "RotatingLockScreenOverlayEnabled" /D 0 /F
  252. #Preinstalled apps, Minecraft Twitter etc all that - still need a clean default start menu to fully eliminate
  253. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "PreInstalledAppsEnabled" /D 0 /F
  254. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "PreInstalledAppsEverEnabled" /D 0 /F
  255. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "OEMPreInstalledAppsEnabled" /D 0 /F
  256. #MS shoehorning apps quietly into your profile
  257. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SilentInstalledAppsEnabled" /D 0 /F
  258. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "ContentDeliveryAllowed" /D 0 /F
  259. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SubscribedContentEnabled" /D 0 /F
  260. #Ads in File Explorer
  261. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /T REG_DWORD /V "ShowSyncProviderNotifications" /D 0 /F
  262. #Show me the Windows welcome experience after updates and occasionally
  263. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SubscribedContent-310093Enabled" /D 0 /F
  264. #Get tips, tricks, suggestions as you use Windows
  265. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SubscribedContent-338389Enabled" /D 0 /F
  266.  
  267. #Privacy Settings
  268. #Let websites provide local content by accessing language list - appears to reset during OOBE.
  269. #Reg Add "$reglocation\Control Panel\International\User Profile" /T REG_DWORD /V "HttpAcceptLanguageOptOut" /D 1 /F
  270. #Ask for feedback
  271. Reg Add "$reglocation\SOFTWARE\Microsoft\Siuf\Rules" /T REG_DWORD /V "NumberOfSIUFInPeriod" /D 0 /F
  272. Reg Add "$reglocation\SOFTWARE\Microsoft\Siuf\Rules" /T REG_DWORD /V "PeriodInNanoSeconds" /D 0 /F
  273. #Let apps use advertising ID
  274. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /T REG_DWORD /V "Enabled" /D 0 /F
  275. #Let Windows track app launches to improve start and search results - includes run history
  276. #Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /T REG_DWORD /V "Start_TrackProgs" /D 0 /F
  277. #Tailored experiences - Diagnostics & Feedback settings
  278. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" /T REG_DWORD /V "TailoredExperiencesWithDiagnosticDataEnabled" /D 0 /F
  279. #Let apps on other devices open messages and apps on this device - Shared Experiences settings
  280. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CDP" /T REG_DWORD /V "RomeSdkChannelUserAuthzPolicy" /D 0 /F
  281. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CDP" /T REG_DWORD /V "CdpSessionUserAuthzPolicy" /D 0 /F
  282.  
  283. #Speech Inking & Typing - comment out if you use the pen\stylus a lot
  284. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Language" /T REG_DWORD /V "Enabled" /D 0 /F
  285. Reg Add "$reglocation\SOFTWARE\Microsoft\InputPersonalization" /T REG_DWORD /V "RestrictImplicitTextCollection" /D 1 /F
  286. Reg Add "$reglocation\SOFTWARE\Microsoft\InputPersonalization" /T REG_DWORD /V "RestrictImplicitInkCollection" /D 1 /F
  287. Reg Add "$reglocation\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" /T REG_DWORD /V "HarvestContacts" /D 0 /F
  288. Reg Add "$reglocation\SOFTWARE\Microsoft\Personalization\Settings" /T REG_DWORD /V "AcceptedPrivacyPolicy" /D 0 /F
  289. #Improve inking & typing recognition
  290. Reg Add "$reglocation\SOFTWARE\Microsoft\Input\TIPC" /T REG_DWORD /V "Enabled" /D 0 /F
  291. #Pen & Windows Ink - Show recommended app suggestions
  292. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\PenWorkspace" /T REG_DWORD /V "PenWorkspaceAppSuggestionsEnabled" /D 0 /F
  293.  
  294. #People
  295. #Show My People notifications
  296. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People\ShoulderTap" /T REG_DWORD /V "ShoulderTap" /D 0 /F
  297. #Show My People app suggestions
  298. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /T REG_DWORD /V "SubscribedContent-314563Enabled" /D 0 /F
  299. #People on Taskbar
  300. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" /T REG_DWORD /V "PeopleBand" /D 0 /F
  301.  
  302. #Other Settings
  303. #Use Autoplay for all media and devices
  304. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" /T REG_DWORD /V "DisableAutoplay" /D 1 /F
  305. #Taskbar search, personal preference. 0 = no search, 1 = search icon, 2 = search bar
  306. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "SearchboxTaskbarMode" /D 0 /F
  307. #Allow search to use location if it's enabled
  308. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "AllowSearchToUseLocation" /D 0 /F
  309. #Do not track - Edge
  310. Reg Add "$reglocation\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Main" /T REG_DWORD /V "DoNotTrack" /D 1 /F
  311. #Do not track - IE
  312. Reg Add "$reglocation\SOFTWARE\Microsoft\Internet Explorer\Main" /T REG_DWORD /V "DoNotTrack" /D 1 /F
  313.  
  314. #--Optional User Settings--
  315.  
  316. #App permissions user settings, these are all available from the settings menu
  317. If ($AppAccess) {
  318. } Else{
  319. #App permissions
  320. #Location - see tablet settings
  321. #Camera
  322. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam" /T REG_SZ /V "Value" /D Deny /F
  323. #Microphone
  324. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone" /T REG_SZ /V "Value" /D Deny /F
  325. #Notifications - doesn't appear to work in 1803, setting hasn't been moved as of 1803 like most of the others
  326. #Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{52079E78-A92B-413F-B213-E8FE35712E72}" /T REG_SZ /V "Value" /D Deny /F
  327. #Account Info
  328. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" /T REG_SZ /V "Value" /D Deny /F
  329. #Contacts
  330. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\contacts" /T REG_SZ /V "Value" /D Deny /F
  331. #Calendar
  332. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appointments" /T REG_SZ /V "Value" /D Deny /F
  333. #Call history
  334. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCallHistory" /T REG_SZ /V "Value" /D Deny /F
  335. #Email
  336. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\email" /T REG_SZ /V "Value" /D Deny /F
  337. #Tasks
  338. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks" /T REG_SZ /V "Value" /D Deny /F
  339. #TXT/MMS
  340. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\chat" /T REG_SZ /V "Value" /D Deny /F
  341. #Radios - doesn't appear to work in 1803, setting hasn't been moved as of 1803 like most of the others
  342. #Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{A8804298-2D5F-42E3-9531-9C8C39EB29CE}" /T REG_SZ /V "Value" /D Deny /F
  343. #Other Devices - reset during OOBE
  344. #Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\LooselyCoupled" /T REG_SZ /V "Value" /D Deny /F
  345. #Cellular Data
  346. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\cellularData" /T REG_SZ /V "Value" /D Deny /F
  347. #Allow apps to run in background global setting - seems to reset during OOBE
  348. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /T REG_DWORD /V "GlobalUserDisabled" /D 1 /F
  349. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "BackgroundAppGlobalToggle" /D 0 /F
  350. #App Diagnostics - doesn't appear to work in 1803, setting hasn't been moved as of 1803 like most of the others
  351. #Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{2297E4E2-5DBE-466D-A12B-0F8286F0D9CA}" /T REG_SZ /V "Value" /D Deny /F
  352. #My Documents
  353. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary" /T REG_SZ /V "Value" /D Deny /F
  354. #My Pictures
  355. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary" /T REG_SZ /V "Value" /D Deny /F
  356. #My Videos
  357. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary" /T REG_SZ /V "Value" /D Deny /F
  358. #File System
  359. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess" /T REG_SZ /V "Value" /D Deny /F
  360. }
  361.  
  362. #Disable Cortana - use -Cortana to leave it on
  363. If ($Cortana){
  364. } Else{
  365. #Disable Cortana and Bing search user settings
  366. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "CortanaEnabled" /D 0 /F
  367. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "CanCortanaBeEnabled" /D 0 /F
  368. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "DeviceHistoryEnabled" /D 0 /F
  369. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "CortanaConsent" /D 0 /F
  370. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "CortanaInAmbientMode" /D 0 /F
  371. #Disable Bing search from start menu/search bar
  372. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "BingSearchEnabled" /D 0 /F
  373. #Disable Cortana on lock screen
  374. Reg Add "$reglocation\SOFTWARE\Microsoft\Speech_OneCore\Preferences" /T REG_DWORD /V "VoiceActivationEnableAboveLockscreen" /D 0 /F
  375. #Disable Cortana search history
  376. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /T REG_DWORD /V "HistoryViewEnabled" /D 0 /F
  377. }
  378.  
  379. #Tablet Settings - use -Tablet switch to leave these on
  380. If ($Tablet) {
  381. } Else {
  382. #Deny access to location and sensors
  383. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Permissions\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /T REG_DWORD /V "SensorPermissionState" /D 0 /F
  384. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /T REG_SZ /V "Value" /D Deny /F
  385. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{E6AD100E-5F4E-44CD-BE0F-2265D88D14F5}" /T REG_SZ /V "Value" /D Deny /F
  386. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" /T REG_SZ /V "Value" /D Deny /F
  387. }
  388.  
  389. #Game settings - use -Xbox to leave these on
  390. If ($Xbox) {
  391. } Else {
  392. #Disable Game DVR
  393. Reg Add "$reglocation\System\GameConfigStore" /T REG_DWORD /V "GameDVR_Enabled" /D 0 /F
  394. }
  395.  
  396. #OneDrive settings - use -OneDrive switch to leave these on
  397. If ($OneDrive) {
  398. } Else {
  399. #Disable OneDrive startup run user settings
  400. Reg Add "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /T REG_BINARY /V "OneDrive" /D 0300000021B9DEB396D7D001 /F
  401. #Disable automatic OneDrive desktop setup for new accounts
  402. If ($reglocation -ne "HKCU") {
  403. Reg Delete "$reglocation\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /V "OneDriveSetup" /F
  404. }
  405. }
  406.  
  407. #End user registry settings
  408. }
  409.  
  410.  
  411. #Set local machine settings and local group policies
  412. Function RegSetMachine {
  413. #--Local GP settings-- CONVERT THESE TO HKCU / DEFAULT / HKLM WHERE POSSIBLE
  414. #Can be adjusted in GPedit.msc in Pro+ editions.
  415. #Local Policy\Computer Config\Admin Templates\Windows Components
  416. #/Application Compatibility
  417. #Turn off Application Telemetry
  418. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /T REG_DWORD /V "AITEnable" /D 0 /F
  419. #Turn off inventory collector
  420. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /T REG_DWORD /V "DisableInventory" /D 1 /F
  421.  
  422. #/Cloud Content
  423. #Turn off Consumer Experiences - Enterprise only (for Pro, HKCU settings and start menu cleanup achieve same result)
  424. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /T REG_DWORD /V "DisableWindowsConsumerFeatures" /D 1 /F
  425. #Turn off all spotlight features
  426. #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /T REG_DWORD /V "DisableWindowsSpotlightFeatures" /D 1 /F
  427.  
  428. #/Data Collection and Preview Builds
  429. #Set Telemetry to off (switches to 1:basic for W10Pro and lower)
  430. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /T REG_DWORD /V "AllowTelemetry" /D 0 /F
  431. #Disable pre-release features and settings
  432. #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /T REG_DWORD /V "EnableConfigFlighting" /D 0 /F
  433. #Do not show feedback notifications
  434. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /T REG_DWORD /V "DoNotShowFeedbackNotifications" /D 1 /F
  435.  
  436. #/Store
  437. #Disable all apps from store, commented out by default as it will break the store
  438. #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /T REG_DWORD /V "DisableStoreApps" /D 1 /F
  439. #Turn off Store, left disabled by default
  440. #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /T REG_DWORD /V "RemoveWindowsStore" /D 1 /F
  441.  
  442. #/Sync your settings - commented out by default to keep functionality of sync service
  443. #Do not sync (anything)
  444. #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /T REG_DWORD /V "DisableSettingSync" /D 2 /F
  445. #Disallow users to override this
  446. #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /T REG_DWORD /V "DisableSettingSyncUserOverride" /D 1 /F
  447.  
  448. #Add "Run as different user" to context menu
  449. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /T REG_DWORD /V "ShowRunasDifferentuserinStart" /D 1 /F
  450.  
  451. #!!!None of these effective anymore in 1803!!! Now handled by HKCU settings
  452. #Disallow web search from desktop search
  453. #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /T REG_DWORD /V "DisableWebSearch" /D 1 /F
  454. #Don't search the web or display web results in search
  455. #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /T REG_DWORD /V "ConnectedSearchUseWeb" /D 0 /F
  456. #Don't allow search to use location
  457. #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /T REG_DWORD /V "AllowSearchToUseLocation" /D 0 /F
  458.  
  459. #/Windows Update
  460. #Turn off featured SOFTWARE notifications through Windows Update
  461. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /T REG_DWORD /V "EnableFeaturedSoftware" /D 0 /F
  462.  
  463. #--Non Local GP Settings--
  464. #Delivery Optimization settings - sets to 1 for LAN only, change to 0 for off
  465. Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /T REG_DWORD /V "DownloadMode" /D 1 /F
  466. Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /T REG_DWORD /V "DODownloadMode" /D 1 /F
  467. Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings" /T REG_DWORD /V "DownloadMode" /D 1 /F
  468.  
  469. #Disabling advertising info and device metadata collection for this machine
  470. Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /T REG_DWORD /V "Enabled" /D 0 /F
  471. Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" /V "PreventDeviceMetadataFromNetwork" /T REG_DWORD /D 1 /F
  472.  
  473. #Disable CEIP. GP setting at: Computer Config\Admin Templates\System\Internet Communication Managemen\Internet Communication settings
  474. Reg Add "HKLM\SOFTWARE\Microsoft\SQMClient\Windows" /T REG_DWORD /V "CEIPEnable" /D 0 /F
  475.  
  476. #Turn off automatic download/install of store app updates
  477. #Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /T REG_DWORD /V "AutoDownload" /D 2 /F
  478.  
  479. #Prevent using sign-in info to automatically finish setting up after an update
  480. Reg Add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /T REG_DWORD /V "ARSOUserConsent" /D 2 /F
  481.  
  482. #Prevent apps on other devices from opening apps on this one - disables phone pairing
  483. #Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SmartGlass" /T REG_DWORD /V "UserAuthPolicy" /D 0 /F
  484.  
  485. #Enable diagnostic data viewer
  486. Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\EventTranscriptKey" /T REG_DWORD /V "EnableEventTranscript" /D 1 /F
  487.  
  488. #Disable Edge desktop shortcut
  489. Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /T REG_DWORD /V "DisableEdgeDesktopShortcutCreation" /D 1 /F
  490.  
  491. #Filter web content through smartscreen. Left enabled by default.
  492. #Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" /T REG_DWORD /V "EnableWebContentEvaluation" /D 0 /F
  493.  
  494. #--Optional Machine Settings--
  495.  
  496. #Disable Cortana - use -Cortana to leave it on
  497. If ($Cortana){
  498. } Else{
  499. #Cortana local GP - Computer Config\Admin Templates\Windows Components\Search
  500. #Disallow Cortana
  501. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /T REG_DWORD /V "AllowCortana" /D 0 /F
  502. #Disallow Cortana on lock screen - seems pointless with above setting, may be deprecated, covered by HKCU anyways
  503. #Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /T REG_DWORD /V "AllowCortanaAboveLock" /D 0 /F
  504. }
  505.  
  506. #Tablet Settings - use -Tablet switch to leave these on
  507. If ($Tablet) {
  508. } Else {
  509. #Turn off location - global
  510. Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" /T REG_SZ /V "Value" /D Deny /F
  511. }
  512.  
  513. #Game settings - use -Xbox to leave these on
  514. If ($Xbox) {
  515. } Else {
  516. #Disable Game Monitoring Service
  517. Reg Add "HKLM\SYSTEM\CurrentControlSet\Services\xbgm" /T REG_DWORD /V "Start" /D 4 /F
  518. #GameDVR local GP - Computer Config\Admin Templates\Windows Components\Windows Game Recording and Broadcasting
  519. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\GameDVR" /T REG_DWORD /V "AllowGameDVR" /D 0 /F
  520. }
  521.  
  522. #OneDrive settings - use -OneDrive switch to leave these on
  523. If ($OneDrive) {
  524. } Else {
  525. #Prevent usage of OneDrive local GP - Computer Config\Admin Templates\Windows Components\OneDrive
  526. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /T REG_DWORD /V "DisableFileSyncNGSC" /D 1 /F
  527. Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /T REG_DWORD /V "DisableFileSync" /D 1 /F
  528. #Remove OneDrive from File Explorer
  529. Reg Add "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /T REG_DWORD /V "System.IsPinnedToNameSpaceTree" /D 0 /F
  530. Reg Add "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /T REG_DWORD /V "System.IsPinnedToNameSpaceTree" /D 0 /F
  531. }
  532.  
  533. #End machine registry settings
  534. }
  535.  
  536.  
  537. #Clean up the default start menu
  538. Function ClearStartMenu {
  539. If ($ClearStart) {
  540. Write-Host "***Setting empty start menu for new profiles...***"
  541. #Don't edit this. Creates empty start menu if -ClearStart is used.
  542. $StartLayoutStr = @"
  543. <LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout">
  544. <LayoutOptions StartTileGroupCellWidth="6" />
  545. <DefaultLayoutOverride>
  546. <StartLayoutCollection>
  547. <defaultlayout:StartLayout GroupCellWidth="6" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout">
  548. </defaultlayout:StartLayout>
  549. </StartLayoutCollection>
  550. </DefaultLayoutOverride>
  551. </LayoutModificationTemplate>
  552. "@
  553. add-content $Env:TEMP\startlayout.xml $StartLayoutStr
  554. import-startlayout -layoutpath $Env:TEMP\startlayout.xml -mountpath $Env:SYSTEMDRIVE\
  555. remove-item $Env:TEMP\startlayout.xml
  556. } Else {
  557. Write-Host "***Setting clean start menu for new profiles...***"
  558. #Custom start layout XML near the top of the script.
  559.  
  560. add-content $Env:TEMP\startlayout.xml $StartLayoutStr
  561. import-startlayout -layoutpath $Env:TEMP\startlayout.xml -mountpath $Env:SYSTEMDRIVE\
  562. remove-item $Env:TEMP\startlayout.xml
  563. }
  564. }
  565.  
  566.  
  567. #Goodbye Message Function
  568. Function Goodbye {
  569. Write-Host "*******Decrapification complete.*******"
  570. Write-Host "*******Remember to set your execution policy back! Set-Executionpolicy restricted is the Windows 10 default.*******"
  571. Write-Host "*******Reboot your computer now!*******"
  572. }
  573.  
  574. #---End of functions---
  575.  
  576.  
  577. #Decrapify
  578. If ($NoLog) {
  579. }Else {
  580. Start-Transcript $ENV:SYSTEMDRIVE\WindowsDCtranscript.txt
  581. }
  582. Write-Host "******Decrapifying Windows 10...******"
  583. If ($AppsOnly) {
  584. RemoveApps
  585. ClearStartMenu
  586. Goodbye
  587. }Elseif ($SettingsOnly) {
  588. DisableTasks
  589. DisableServices
  590. RegChange
  591. ClearStartMenu
  592. Goodbye
  593. }Else {
  594. RemoveApps
  595. DisableTasks
  596. DisableServices
  597. RegChange
  598. ClearStartMenu
  599. Goodbye
  600. }
  601.  
  602. If ($NoLog) {
  603. }Else {
  604. Stop-Transcript
  605. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement