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

 


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

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

    • Valnurat
      Powershell n00b question
      By Valnurat
      Hi experts.
      I'm trying to get this to work:
      https://www.autoitscript.com/forum/topic/173949-using-the-autoit-powershell-cmdlets/
      but I get an error:  error: syntax error (illegal character)

      "Import-Module .\"
      Can anyone help me?

    • bstjohn
      Silent uninstall broken in Win10 -- need suggestions for workaround
      By bstjohn
      I'm running AutoIT v3.3.14.2 on Windows 10 ver 1511.  The September Cumulative Update from Microsoft has broken the way some third party credential providers work.  You can see more detail here:  https://www.novell.com/support/kb/doc.php?id=7018051
      So I want to automatically and silently remove this update from all our machines.  In Windows 7 I could easily do it with this:
      wusa.exe /uninstall /kb:3185614 /quiet
      But apparently Microsoft has taken away the /quiet switch functionality in Windows 10.   wusa /? will show that the switch is there, but when trying to use it error 87 (invalid parameter) is returned.
      So I relented on that point and decided to run wusa without the quiet switch.  It pops up a child window that prompts for confirmation before uninstalling the update.  Sounds like a perfect job for AutoIT, right?  Except I can't get the button to click, either using ControlClick or ControlSend or Send.  I can select it by sending the {Alt} key to it and it highlights.  But I just can't get it to accept the click or {Enter}.
      I then tried using Powershell and DISM to remove the package, but this is a hotfix and doesn't have a package name, so I can't use dism /remove-package, either.
      Does anybody have any other ideas how this can be done silently?
    • TechScott
      Can I user AutoIT as a front-end to Powershell?
      By TechScott
      I have a rather heady PowerShell script that requires a few inputs that I would like to present as pick lists/pull down lists.  I've fiddled with doing this using Windows API calls and frankly it's pretty ugly and non-productive.  What I'd like to accomplish is to present the user with a refined UI that will force them to color between the lines and catch any error putput and display it to them in an organized fashion.
      Has anyone done this?  I'd like to have an AutoIT based solution as my current client didn't plan on any extra time or budget to accomplish this task.
      Thanks,
      -Scott.
    • iamtheky
      certificate search by thumbprint
      By iamtheky
      #include<array.au3> _ArrayDisplay(_GetCertByThumb("")) ;~ "A1B9894B9BB100F43A229D65CC3C306FBF0BB9F8" Func _GetCertByThumb($sThumbprint = "") $sCommands = 'Powershell get-childitem -Path Cert:\CurrentUser -Recurse -Name | FindStr /L "\\"' & $sThumbprint $iPID = Run(@ComSpec & " /c " & $sCommands, "", @SW_HIDE , $stdout_child) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $aRtn = stringsplit($sOutput , @LF , 2) _ArrayDelete($aRtn , ubound($aRtn) - 1) If ubound($aRtn) < 1 then _ArrayAdd($aRtn , "No Match Found") Return $aRtn EndFunc  
    • water
      Analyzing COM objects
      By water
      Just for the records:
       
      MS provides an easy method to retrieve the methods, properties, events of COM objects by using PowerShell.
      Open powershell. Create the object. The syntax is:
      $variable = New-object -ComObject "ProgID" Type the variable name to retrieve the properties of the object Use "Get-Member" to retrieve all properties, methods, collections and events of the object Example: 
      $IE = New-object -ComObject "InternetExplorer.Application" $IE $IE|Get-Member PS> $object = New-Object -COMObject "InternetExplorer.Application" PS> $object Application          : System.__ComObject Parent               : System.__ComObject Container            : Document             : TopLevelContainer    : True Type                 : Left                 : 309 Top                  : 92 Width                : 1383 Height               : 870 LocationName         : LocationURL          : Busy                 : False Name                 : Windows Internet Explorer HWND                 : 2361028 FullName             : C:\Program Files\Internet Explorer\iexplore.exe Path                 : C:\Program Files\Internet Explorer\ Visible              : False StatusBar            : True StatusText           : ToolBar              : 1 MenuBar              : True FullScreen           : False ReadyState           : 0 Offline              : False Silent               : False RegisterAsBrowser    : False RegisterAsDropTarget : True TheaterMode          : False AddressBar           : True Resizable            : True PS> $object|Get-Member    TypeName: System.__ComObject#{d30c1661-cdaf-11d0-8a3e-00c04fc9e26e} Name                 MemberType Definition ----                 ---------- ---------- ClientToWindow       Method     void ClientToWindow (int, int) ExecWB               Method     void ExecWB (OLECMDID, OLECMDEXECOPT, Variant, Variant) GetProperty          Method     Variant GetProperty (string) GoBack               Method     void GoBack () GoForward            Method     void GoForward () GoHome               Method     void GoHome () GoSearch             Method     void GoSearch () Navigate             Method     void Navigate (string, Variant, Variant, Variant, Variant Navigate2            Method     void Navigate2 (Variant, Variant, Variant, Variant, Varia PutProperty          Method     void PutProperty (string, Variant) QueryStatusWB        Method     OLECMDF QueryStatusWB (OLECMDID) Quit                 Method     void Quit () Refresh              Method     void Refresh () Refresh2             Method     void Refresh2 (Variant) ShowBrowserBar       Method     void ShowBrowserBar (Variant, Variant, Variant) Stop                 Method     void Stop () AddressBar           Property   bool AddressBar () {get} {set} Application          Property   IDispatch Application () {get} Busy                 Property   bool Busy () {get} Container            Property   IDispatch Container () {get} Document             Property   IDispatch Document () {get} FullName             Property   string FullName () {get} FullScreen           Property   bool FullScreen () {get} {set} Height               Property   int Height () {get} {set} HWND                 Property   int64 HWND () {get} Left                 Property   int Left () {get} {set} LocationName         Property   string LocationName () {get} LocationURL          Property   string LocationURL () {get} MenuBar              Property   bool MenuBar () {get} {set} Name                 Property   string Name () {get} Offline              Property   bool Offline () {get} {set} Parent               Property   IDispatch Parent () {get} Path                 Property   string Path () {get} ReadyState           Property   tagREADYSTATE ReadyState () {get} RegisterAsBrowser    Property   bool RegisterAsBrowser () {get} {set} RegisterAsDropTarget Property   bool RegisterAsDropTarget () {get} {set} Resizable            Property   bool Resizable () {get} {set} Silent               Property   bool Silent () {get} {set} StatusBar            Property   bool StatusBar () {get} {set} StatusText           Property   string StatusText () {get} {set} TheaterMode          Property   bool TheaterMode () {get} {set} ToolBar              Property   int ToolBar () {get} {set} Top                  Property   int Top () {get} {set} TopLevelContainer    Property   bool TopLevelContainer () {get} Type                 Property   string Type () {get} Visible              Property   bool Visible () {get} {set} Width                Property   int Width () {get} {set}