unable to uninstall windows store app using SCCM Task Sequence

Salanje Banda 20 Reputation points

I tried to run the following two commands manually on one of the machine and it worked.However,i tried to push the same commands through sccm task sequence on another machine as available.I run it and it showed successful but unfortunately the app is still appearing on the computer after running the first command l have shared.What am i missing?

Get-WmiObject -Query "select version from Win32_InstalledStoreProgram where name='Microsoft.ECApp'"

Get-AppxPackage -User alfred.cb.lim | Where-Object {$_.Name-match ".Microsoft.ECApp*.*"} | Remove-AppxPackage

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
8,888 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
6,021 questions
Microsoft Configuration Manager
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
1,315 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Simon Ren-MSFT 23,141 Reputation points Microsoft Vendor


    1,We can run the command line step with local admin privilege user account to have a try.

    2,If this still fails, we can use PsExec.exe to run the package/program under a specified credential to have a try. For more detailed information, please refer to:

    How to Access the Local System Account

    MDT/SCCM 2010 - Running Applications Installations under different credentials


    Hope it helps. Have a nice day!

    Best regards,


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. MotoX80 27,461 Reputation points

    That is what i have done in user context but still failing

    Add logging and troubleshooting statements to your script to capture errors and verify that your variables contain the data that you think they have.

    Save a C:\temp\Uninstall.ps1 script on the target PC and have Powershell execute the .ps1 file. Use a folder that has "everyone full control".

    Start-Transcript C:\Temp\Uninstall.log  
    "This process is executing as the following account."
    $appx = Get-AppxPackage -User alfred.cb.lim
    "We found {0} packages." -f $appx.count
    $ECA = $appx | Where-Object {$_.Name-match ".Microsoft.ECApp*.*"} 
    "We found {0} ECApp packages." -f $ECA.count
    $ECA | Remove-AppxPackage

    Review the transcript log file.

    Maybe you should just uninstall it for all users? "Get-AppxPackage -Allusers".

    0 comments No comments