Sign in to follow this  
Followers 0
ViciousXUSMC

Remove Windows Apps for All Users

7 posts in this topic

I have messed with this time to time, but recently decided to go ahead and push it out because I have so many people having the default reader app take over adobe and since they are not admins they cant easily change the default program to adobe for their profile.

To remove the app for the current user I use.

get-appxpackage | where name -like '*reader*' | remove-appxpackage

If it is a new computer build I can remove the app from the system so it does not install for any new users with this.

get-provisionedappxpackage -online | where displayname -like '*reader*' | remove-appxprovisionedpackage -online

So where I am stuck is getting it off existing accounts on computers in the field.  Every article, document, etc I can find says all you need to do is add the -allusers flag.

If I add the flag to the get package part it does show the package for each user, but when I pipe it into the remove-package cmdlet I get an error that the package is not installed for the current user and it does not uninstall it for any other account.

This is what I have tried:

get-appxpackage -allusers | where name -like '*reader*' | remove-appxpackage

Also a revision of it

get-appxpackage -allusers *reader* | remove-appxpackage

As far as I can tell, this is correct but simply is not working. 

Any ideas or anybody know what the key issue that I am overlooking is?

Share this post


Link to post
Share on other sites



Have you tried something like this?

Get-AppxPackage -allusers -Name *reader* | Remove-AppxPackage

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
14 hours ago, JLogan3o13 said:

Have you tried something like this?

Get-AppxPackage -allusers -Name *reader* | Remove-AppxPackage

 

Yes, that was an alteration I tried.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You know, there are scripts available on Microsoft's script repository that might be of help.  I would try these:
https://gallery.technet.microsoft.com/scriptcenter/Remove-Windows-Store-Apps-a00ef4a4

https://gallery.technet.microsoft.com/scriptcenter/Windows-10-Store-Apps-5f60b9e3

http://www.thewindowsclub.com/10appsmanager-windows-10

These might get you to where you need to be.

Edited by MattHiggs

Share this post


Link to post
Share on other sites

I'll check it out.  Thanks.

Share this post


Link to post
Share on other sites

You must be trying on a system with the 1511 Windows update. I've been working with this extensively and the behavior you described seems to be unique to Windows build 1511. The command you provided it works on previous builds, and it works on the new 1607 anniversary update.

First off for these purposes "allusers" is not allusers in the conventional sense like the All Users folder was in previous versions of Windows. When you run the get-appxpackage command with the -allusers switch it's simply spitting out a list of apps which exist in one or more user profiles on the computer.

get-appxpackage -allusers | where name -like '*reader*' | remove-appxpackage

For any version other than 1511 the command behaves something like this:
Generate a list of apps installed all user profiles. If '*reader*' exists remove it from ANY profile in which it exists.

For some reason in build 1511 the command behaves this:
Generate a list of apps installed on all user profiles. If '*reader*' exists remove from the current user profile only.

I have yet to find an eloquent solution for removing apps from all users in 1511, but at least it's fixed in 1607. I know this doesn't really help, but hopefully provides some insight as to why it's not working for you.

 

Share this post


Link to post
Share on other sites

I'm thinking the scripts I previously posted links to got him where he needed to be:D.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • tcox8
      By tcox8
      Hello,
      Currently I am running a script that calls a powershell script. To read the results of that I am reading StdOut. I am parsing things accordingly but unfortunately it doesn't parse correctly all the time and I end up missing parts of the string or other problems. My question then is, what is the best results for reading what is returned when running a powershell script or something similar?
    • WoodGrain
      By WoodGrain
      Hi guys,
      This is probably an obvious one, but I really don't use this command at all so am hoping you can spot my mistake.
      I'm running a powershell script on a schedule with the following script in a function, the function is being called in a loop, but the console process is not closing in the background and I end up with a bunch of console windows running in the background:
      Run(@comspec & ' /k PowerShell.exe -STA -NonInteractive -ExecutionPolicy ByPass -Command "& ''Z:\Powershell\365\GetNextDetails.ps1'' "', "", @SW_HIDE) Thanks!
    • caramen
      By caramen
      !Arf it i used [Start new topic] when i was in GUI section and the post was moved without i even noticed it. Can an admin move that to general (SORRY)!
       
      Hello guys ME again and my ugly english xD.
       
      This is the only one powershell command i am not able to use becose i dont found a way to insert the USERNAME $Variable at the first line. i am not able to find a third way to QUOTE a variable when i use "*" for the AutoIt command and the '*' for the PS command but i need to QUOTE inside the '*'PS command my $Variable
       
      $iPid = run("powershell get-aduser -Filter {sn -eq 'USERNAME'} -Properties sAMAccountName,Title" , @WindowsDir , @SW_HIDE , 0x2) $AllInfo = "" While 1 $AllInfo &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $AllInfo = stringsplit($AllInfo , @LF , 2) ;split result in all @LF but don't use the splitted result for anything _ArrayDisplay($AllInfo) This gonna be my last question becose i can do all the rest (i guess & wish ) alone
       
    • caramen
      By caramen
      Hello.
      I improved my powershell skill like F**** !! I am so happy Level skill under beginner HAHA well i am just getting what i want but now i got a question about autoit + powershell
      When i run that Shellcommand 
      $iPid = run("Powershell Get-ADUser USER -Properties * | select -Expand Title"  , @WindowsDir , @SW_HIDE , 0x2)
       
      The return valu is :
      Micro r,seau (this is normal in PowerShell)
      Can i transform the value
      Micro réseau with autoit 
    • profyt7
      By profyt7
      Hey Guys,
      I am almost there but feel I am missing something that is right in front of me and need another set of eyes.
       
      I am trying to run the following powershell file with the following parameters. This works in powershell just fine.
      Reset-LocalAdminPassword.ps1 -Password $secureString
       
      I created an autoit script to do a few other things but from venturing in the forums I found some code and did the following:
      ;THIS COMMAND WILL RUN THE powershell script
      $iDir = "C:\test\script\Reset-LocalAdminPassword.ps1"
      Run('cmd /k C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File ' & '"' & $iDir & '-Password $secureString')
      Sleep(15000)
       
      The problem is that when it runs it gives me a message that C:\test\script\Reset-LocalAdminPassword.ps1-Password $secureString' is not a valid ps1 file.
      I cannot seem to get it to run the ps1 file with the -Password $secureString' parameter. It keeps cobining the ps1 path and the parameters all as one.
      I am sure this is something I am overlooking but I have been battling with this for a few hours now and just don't know what I am missing.