none
Removing LOB app for all users using SCCM or powershell or alternate process

    Question

  • We're currently using Microsoft System Center - Software Center to manage appx distribution via script.

    The scenario we are trying to resolve is this.

    Business has distribute an app as a provisioned app to all users.

    Business wants to deploy new version of the app, but prior wants to force remove all previous versions of the app or perhaps any app that matches a particular app string so only the new version will be used.

    What is the recommended method for removing the provisioned app for all users and then adding the new provisioned app?

    The issue we keep getting is either we version the app so both apps exist on the machine which we don't want especially if the manifest has the same app name, but also as a we don't want old versions of the app floating around in the business or we keep the same versioning of the app but then we cannot install it because some users have the app locally with the same name.

    In essence, for an LOB app on devices owned by the business, is it possible to remove an app for all users  (even non-logged in ones, who have logged in in the past) without writing a login script so that a new app can be deployed. 

    Also if so is there a powershell script out ther ethat behaves differently?

    Neither remove-appxprovisionedpackage nor remove-appxpackage with all users flags and pipes or anything else seems to work even in windows 10 build 1607.

    A scouring of the internet came up blank....

    

    Monday, February 13, 2017 11:04 PM

All replies

  • Hi Eli,

    >>What is the recommended method for removing the provisioned app for all users and then adding the new provisioned app?

    If you want to update a provisioned app, you need to remove the provisioned app and then deploy the new version of the app. The update will then be applied the next time each user logs in.

    About details info, you can refer to update a provisioned LOB app and remove apps

    Best Regards,

    Cherry Bu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 14, 2017 8:24 AM
    Moderator
  • Right but removing a provisioned app does not remove the app for installed users.

    Based on your response:

    Add-AppxProvisionedPackage -Online -FolderPath C:\mypackage.appx

    *Users Login and Package is Provisioned Correctly*

    Remove-AppxProvisionedPackage -Online -PackageName

    *Provisioned Package is removed, however locally installed versions for the users who logged in still exist but are now obsolete.* *Now Provision the new package, user has 2 installed versions of the app on next login the old and the new*

    In an ideal world I want the sccm package or using domain admin priveleges to remove these old packages. I cannot.

    My net searching has found some suggestion of Get-AppxPackage -AllUsers {packageName} | Remove-AppxPackage which some indicate will remove the local version for all users but this does not appear to work for me even after reboot. Perhaps their are some conditions or a bug fix / patch that needs applied ot make this work?

    It will work for the remaining package if the user is logged in, ( he can also simply run Remove-AppxPackage {PackageName} )Name however there are several copies installed via the provisioning function that I can reach without instigating a user login ( obviously logging as the user using there password is out of the question, but perhaps there is an impersonation method that can be used?) which I would like to remove using SCCM or powershell.

    In my opinion just like an admin can delete  users profiles, uninstalling their apps without logging in to their accounts should be possible via a simple command

    Alternately, any workaround that domain or machine admin privileges would have available is acceptable even if it requires getting a list of the users via a script and Get-Appx who have used the app and then walking that list using impersonation of some sort and executing Remove-AppxPackage per user. I imagine this might be possible in powershell but am not sure.

    



    • Edited by Eli McNally Wednesday, February 15, 2017 3:32 PM
    Wednesday, February 15, 2017 3:23 PM
  • See above, response does not address problem.
    Wednesday, February 15, 2017 3:37 PM