Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Remove MS Store with Powershell task

Kinda at a stoppage with trying to disable windows store on a set up laptops. I have tried to run this as a task after making sure execution policy was set correctly Get-AppxPackage windowsstore | Remove-AppxPackage I have tried copying a ps1 file and calling powershell to open the file I have tried compiling Get-AppxPackage windowsstore | Remove-AppxPackage into an EXE and calling CMD to open it. All the tasks complete but the store remains. I can goto on of the computers and manually run the exe or the PS CMD and it removes the store. Not sure whats going on but whatever the cause it's very frustrating.

0

Comments

2 comments
Date Votes
  • Check your Run As in your deployment settings. Window Apps will install for each unique user and any new unique users on the machine. If you run a script to uninstall or manually uninstall, it will always come back when a new unique user signs into the computer.

    As to why it is not removing. If you have the Run As set to deploy user, then it is only removing from the user with deploy access. Switching to Logged on user will uninstall to the current logged on user.

    run as

    References:

    https://www.pdq.com/blog/remove-appx-packages/

    https://www.pdq.com/blog/removing-windows-10-apps-and-advertising/

    https://support.pdq.com/knowledge-base/1353

    0
  • For win 8.1 I have one deploy package with 3 powershell steps, working in domain for all users, old and new (not run as logged on user)

    Step 1 - Remove All Metro Apps

    Get-AppxPackage -AllUsers | Remove-AppxPackage
    

    Step 2 - Block access to MS Store

    Get-appxprovisionedpackage –online | where-object {$_.packagename –notlike "*store*"} | Remove-AppxProvisionedPackage -online
    

    Step 3 - Block WinStore Auto Download

    $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"
    $Name = "AutoDownload"
    $value = "2"
    IF(!(Test-Path $registryPath))
      {
        New-Item -Path $registryPath -Force | Out-Null
        New-ItemProperty -Path $registryPath -Name $name -Value $value `
        -PropertyType DWORD -Force | Out-Null}
     ELSE {
        New-ItemProperty -Path $registryPath -Name $name -Value $value `
        -PropertyType DWORD -Force | Out-Null}
    
    0