Advertisement
Guest User

Untitled

a guest
Jul 5th, 2016
719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.76 KB | None | 0 0
  1. **Option 1 - Remove for Existing Users using Administrative PowerShell**
  2.  
  3. This method uses the PowerShell included in Windows 10 Pro to remove UWP apps, also known as Appx Packages, from pre-existing users on a computer.
  4.  
  5. First, run PowerShell as Administrator by searching for it in start and right clicking > Run as administrator.
  6.  
  7. [![Open PowerShell as Administrator][1]][1]
  8.  
  9. Next, get a list of installed packages. To do this, we could type `Get-AppxPackage` and read the million things that come up. Instead we will pipe it to the select command that only output's the packages short name, and then we will pipe it to the sort command to sort it alphabetically (just to look nice).
  10.  
  11. Get-AppxPackage | select name | sort name
  12.  
  13. This will produce an output like this:
  14.  
  15. [![Packages][2]][2]
  16.  
  17. For this example, we're going to delete all Bing apps (News, Sports, Weather, etc.) To do that, we again get the Appx Packages, but this time use wildcards to get them by name. We then pipe them to the `Remove-AppxPackage` command, which is pretty self-explanatory.
  18.  
  19. Get-AppxPackage -name *Bing* | Remove-AppxPackage
  20.  
  21. PowerShell will display a deployment process, then give you back control. Getting the Appx Packages by name afterwards returns the following, void of all Bing apps:
  22.  
  23. [![Bing apps gone][3]][3]
  24.  
  25. To remove the Windows Store itself, do the same as above:
  26.  
  27. Get-AppxPackage -name *WindowsStore* | Remove-AppxPackage
  28.  
  29. These commands only remove apps from the current user. To remove them for all users on the computer, add the `-allusers` flag like so:
  30.  
  31. Get-AppxPackage -allusers -name *Bing* | Remove-AppxPackage
  32.  
  33.  
  34. **Option 2 - Removing for All Users by Restricting Access to the WindowsApps Folder**
  35.  
  36. This method is more complicated, but also more robust. We will be removing System's access from the folder where Windows Apps are installed to then deleting the ones we want gone, so they can't come back.
  37.  
  38. Windows Apps are are stored in `C:\Program Files\WindowsApps\`. This is a hidden folder, so you'll have to show hidden folders first:
  39.  
  40. [![Show hidden items][4]][4]
  41.  
  42. If you try to modify the folder properties right now, you won't be able to. This is because TrustedInstaller is the owner of the folder. To change this, right click on the folder, choose Properties, then go to the Security folder. Click the Advanced button.
  43.  
  44. [![Advanced security][5]][5]
  45.  
  46. The `Owner:` field will either show `TrustedInstaller` or `Unable to display current owner`, as it does for me. Click Change next to Owner to change the owner.
  47.  
  48. [![Change folder owner][6]][6]
  49.  
  50. Change the folder to a local or domain administrator (I did this using a domain administrator, but am using a local administrator for this tutorial). Make sure the `Replace owner on subcontainers and objects` box is checked.
  51.  
  52. [![Owner changed][7]][7]
  53.  
  54. After this step, you will need to click OK and close all open dialogue and properties boxes for changes to take effect. Then, re-open folder properties and go to the security tab. You will now be able to change folder permissions. Click Edit.
  55.  
  56. Fully remove SYSTEM from the list of Groups and user names (this means it won't be able to reinstall apps back into the folder once they're gone). Next, add your local or domain administrator to the list and give yourself Full control.
  57.  
  58. [![enter image description here][8]][8]
  59.  
  60. Finally, go close all dialogue boxes and go into the WindowsApps folder. Select and delete whichever apps you like.
  61.  
  62. [![Delete apps][9]][9]
  63.  
  64. I would recommend KEEPING the .NET framework, as well as the Photos, Calculator, and `windowscommunicationsapps` to ensure that the computer continues to work properly. I removed Zune video and music (the packages for Films & TV and Groove), but this left the computer without music and video playing programs, so you will have to install other programs if you want this functionality.
  65.  
  66. **Final Remarks**
  67.  
  68. Please note that this is a solution-in-progress, I have confirmed that it works across new users and restarts, but do not yet know if it is rock solid. Do NOT perform the steps above if you don't know what you're doing, as it can seriously break your computer if done wrong. I assume no responsibility for anything negative or problematic which may result as a result of following the above steps.
  69.  
  70. Feel free to add to this solution, as I hope it is one that other admins (or just annoyed users) can follow in the future.
  71.  
  72.  
  73. [1]: http://i.stack.imgur.com/jV4jc.png
  74. [2]: http://i.stack.imgur.com/ATNPA.png
  75. [3]: http://i.stack.imgur.com/qmeEu.png
  76. [4]: http://i.stack.imgur.com/bViX6.png
  77. [5]: http://i.stack.imgur.com/brVSA.png
  78. [6]: http://i.stack.imgur.com/X4hNK.png
  79. [7]: http://i.stack.imgur.com/27a2l.png
  80. [8]: http://i.stack.imgur.com/SU82T.png
  81. [9]: http://i.stack.imgur.com/Kws5J.png
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement