Earlier today I got a question on how to remove the default Windows Store and Mail icons from the taskbar in Windows 10 v1703.
The answer is simply, use a group policy.
Remove the Mail icon
Removing the Mail icon can be done by applying a custom taskbar XML file via group policy. Here is an example:
<?xml version="1.0" encoding="utf-8"?>
<LayoutModificationTemplate
xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"
xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout"
xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout"
xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout"
Version="1">
<CustomTaskbarLayoutCollection>
<defaultlayout:TaskbarLayout>
<taskbar:TaskbarPinList>
<taskbar:UWA AppUserModelID="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" />
<taskbar:DesktopApp DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk" />
<taskbar:DesktopApp DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk"/>
</taskbar:TaskbarPinList>
</defaultlayout:TaskbarLayout>
</CustomTaskbarLayoutCollection>
</LayoutModificationTemplate>
Then you configure the group policy, and it can be either a user policy or a computer policy. You find the Start Layout policy in the Policies / Administrative Templates / Start Menu and Taskbar node. Here is an example when it's configured for a computer.

Removing the Windows Store icon
To remove the Windows Store icon you set another group policy, it's a user policy named Do not allow pinning Store app to the Taskbar which you find in the User Configuration / Administrative Templates / Start Menu and Taskbar node. Here is the configured policy.

The result
Below is the default taskbar:

And here is the taskbar after applying the group policy:

Written by Johan Arwidmark
Its not working for me. Anything changed recently?
Sorry, Windows 10 1703 was a while back. I have not tested this in recent versions of Windows 10.
Hmmm, I don't think its working anymore.
Or if there is any workaround to permanently uninstall the mail app for all users, please suggest me.
That's quite easy. Simply run a dism.exe command like the below during the WinPE phase of imaging, or in the offline image before deploying it. Have script drive the dism command it so you can gather offline osvolume variable (OSDISK or OSDTARGETDRIVECACHE) and the right version of the app.
dism.exe /image:E:\ /Remove-ProvisionedAppxPackage /PackageName:microsoft.windowscommunicationsapps_16005.11629.20316.0_neutral_~_8wekyb3d8bbwe
Will this stop other things from being pinned to the task bar?
Nope
If I copy the XML document and use it, all it does is add Internet Explorer to the task bar and does not remove the mail icon…
What version of Windows 10 are you testing on? A lot has changed since Windows 10 1703.
/ Johan
Excellent article. Thank you
function UnPinFromTaskbar { param( [string]$appname )
Try {
((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name -like "Ta bort fr*" -OR $_.Name -like "Unpin from*"} | %{$_.DoIt()}
} Catch {$a="b"}
} #UnPinFromTaskbar
UnPinFromTaskbar "E-Post"
UnPinFromTaskbar "Microsoft Store"
Love it, but for American computers, change E-Post to Mail
This is fantastic, do you have an example to add items to the task bar? Say I wanted to add Word, Excel, Outlook & Teams?
Sorry, I do not. But I know that Jorgen Nilsson over at ccmexec.com has published a few articles on the topic.
/ Johan
Do you have one that unpins them for all users?
Sorry I don't
First picture is gone making this kinda useless
Fixed the post, sorry about that. That part of the post got lost in migration from DNN to WordPress.
What happened to the example?
Sorry for the very late reply. Should be fixed now.
/ Johan