question

Jonashrvall-2889 avatar image
0 Votes"
Jonashrvall-2889 asked Jason-MSFT edited

OSD - Remove Windows Mail

Hi I want to remove Windows Mail in Task Sequence I have done following: ![97454-removewindowsmail.jpg][1] [1]: /answers/storage/attachments/97454-removewindowsmail.jpg The Script; Get-AppxPackage Microsoft.windowscommunicationsapps | Remove-AppxPackage The Script working but not in OSD TS, something I have missed ?

mem-cm-osd
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jason-MSFT avatar image
0 Votes"
Jason-MSFT answered Jason-MSFT commented

Assuming this is for 1809+, you need to add the -AllUsers option to the Remove-Appx cmdlet otherwise it will only run against the current user and also won't remove the provisioning of the package.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your answer,

But I don't understand what you mean Powershell parameters "All Users" ,
How will I do that ?

// :-)

0 Votes 0 ·
SimonRenMSFT-3639 avatar image
0 Votes"
SimonRenMSFT-3639 answered Jonashrvall-2889 commented

Hi,

Thanks for posting in Microsoft MECM Q&A forum.

Agree with Jason here. In Windows 10 version 1809 and later, without -AllUsers parameter, the command doesn't remove the built-in apps in other accounts. The -AllUsers parameter removes the app package for all user accounts on the computer. To completely remove a specific built-in app from Windows 10, please try one of the below commands:

Get-AppxPackage Name | Remove-AppxPackage -allusers
Remove-AppxPackage -AllUsers -Package "PackageFullName"

Thanks for your time.

Best regards,
Simon


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.
https://docs.microsoft.com/en-us/answers/articles/67444/email-notifications.html

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi thanks for your answer, Do you mean that ? Get-AppxPackage Microsoft.windowscommunicationsapps | Remove-AppxPackage -allusers Remove-AppxPackage -AllUsers -Package "Microsoft.windowscommunicationsapps" Sorry it not working ![99061-image.png][1] [1]: /answers/storage/attachments/99061-image.png

0 Votes 0 ·

That's because you entered the two separate PowerShell lines on one line. @SimonRenMSFT-3639's answer has two separate lines.

0 Votes 0 ·

Hi Sorry it works manually but not in TS , see below.. ![99252-image.png][1] [1]: /answers/storage/attachments/99252-image.png

0 Votes 0 ·
Jason-MSFT avatar image
0 Votes"
Jason-MSFT answered

Have you reviewed the log file?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jonashrvall-2889 avatar image
0 Votes"
Jonashrvall-2889 answered

![Yes, ][1] [1]: /answers/storage/attachments/99224-image.png

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jason-MSFT avatar image
0 Votes"
Jason-MSFT answered Jason-MSFT edited

Your command-line is invalid. Why are you using windowscommunicationapps instead of Microsoft.windowscommunicationsapps? You can't just add wildcards to attributes generally.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.