Remove Windows 11 built-in apps via CSP

Microsoft change the behavior of the EnterpriseModernAppManagement CSP in Windows 11.
In Windows 10 you were able to use the same CSP for devices and users.

So, for example you could use

<Delete>
<CmdID>1</CmdID>
<Item>
<Target>   <LocURI>./User/Vendor/MSFT/EnterpriseModernAppManagement/AppManagement/AppStore/Microsoft.GetHelp_8wekyb3d8bbwe</LocURI>
</Target>
</Item>
</Delete>

And

<Delete>
<CmdID>1</CmdID>
<Item>
<Target>   <LocURI>./Device/Vendor/MSFT/EnterpriseModernAppManagement/AppManagement/AppStore/Microsoft.GetHelp_8wekyb3d8bbwe</LocURI>
</Target>
</Item>
</Delete>

for uninstalling the get help app once for the user (1st example) or for all users (2nd example).
As you can see, the only difference is the locURI – which is User or Device.

The first example still works, but if you use the device as target, nothing happens.

After some research I found on the Microsoft Docs I found this example (AppManagement/RemovePackage):

<Exec>
   <CmdID>10</CmdID>
   <Item>
      <Target>
         <LocURI>./Device/Vendor/MSFT/EnterpriseModernAppManagement/AppManagement/RemovePackage</LocURI>
      </Target>
      <Meta><Format xmlns="syncml:metinf">xml</Format></Meta>
      <Data>
          <Package Name="{PackageFullName}" RemoveForAllUsers=1 />
      </Data>
   </Item>
</Exec>

I tried it but nothing happened. The Profile in WSO showed up as installed, but the was not removed. In the Event Log I saw this error:

Error 0xC00CEE24

Looking up 0xC00CEE24 on Camille’s awesome error code collection – HERE – the error codes shows that there is a quore missing.

I created a pull request to update the Microsoft documentation - you can follow the process HERE.


I fixed the CSP which now looks like this:

<Exec>
   <CmdID>10</CmdID>
   <Item>
      <Target>
         <LocURI>./Device/Vendor/MSFT/EnterpriseModernAppManagement/AppManagement/RemovePackage</LocURI>
      </Target>
      <Meta><Format xmlns="syncml:metinf">xml</Format></Meta>
      <Data>
          <Package Name="{PackageFullName}" RemoveForAllUsers="1" />
      </Data>
   </Item>
</Exec>

The number 1 in “RemoveForAllUsers=1 has to be in double quotes. After the fix, the app gets removed for the current logged in user and also for all other users.

For the whole custom CSP take a look at my GitHub where you’ll find anything you need.

Written by
+ posts

Empowering customers in client management since 2012.
Empowering customers in modern management since 2018.

Leave a Reply

Your email address will not be published. Required fields are marked *.

*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

BCF Shop Theme By aThemeArt.
BACK TO TOP