Windows 10 Professional and pinning task bar items
It still bothers me that pinning shortcuts to the taskbar as part of the imaging process for all users, has become such a bother.. particularly when using Windows 10 Pro.
Firstly, anyone who has works with Windows 10 Enterprise needn't worry about this post, as you can simply set your start menu layout, export the layout to an XML file using Powershell and then edit that XML to include the taskbar settings. This can then be deployed to your endpoint machines via GPO. Simple!
For those looking for the documentation, it can be found here: https://docs.microsoft.com/en-us/windows/configuration/windows-10-start-layout-options-and-policies
Of course, if you're using Windows 10 Professional, this becomes problematic.. as the moment you add the taskbar component of that XML file, applying it via GPO causes explorer.exe to end up in an endless crash/restart/crash loop. You can however, still apply your start layout this way without any issues (just don't change the XML file after you've exported it, or it won't work!). It appears that the customisation of Windows 10 Pro isn't entirely supported by Microsoft.
After days of trawling the interwebs looking for a solution, I stumbled across a neat executable written by Stuart Pearson called Pinto10 (https://pinto10blog.wordpress.com/2016/09/10/pinto10/) - which behaves the same way the old Windows 7 "Pinitem.vbs" used to work - It can be called at a command line level, so can be scripted via a simple batch file to do the job.
I extracted the executable to an easily accessible share, and then wrote a quick batch script to map the appropriate shortcuts (a modified version of the script with correct syntax use can be seen below). I then added the batch script as a logon script via GPO (User Configuration > Policies > Windows Settings > Scripts (Logon/Logoff)) , and sure enough, on next login, all my shortcuts exist!
PinitemtoTaskBar.bat
@echo off
IF EXIST C:\Users\%Username%\taskbar.txt goto end
IF NOT EXIST C:\Users\%Username%\taskbar.txt goto addshortcut
:addshortcut
"<path to executable>\PinTo10v2.exe" /pintb "C:\Windows\Explorer.exe"
"<path to executable>\PinTo10v2.exe" /pintb "C:\Program Files\Internet Explorer\iexplore.exe"
"<path to executable>\PinTo10v2.exe" /pintb "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
"<path to executable>\PinTo10v2.exe" /pintb "C:\Program Files (x86)\Microsoft Office\Office16\OUTLOOK.exe"
"<path to executable>\PinTo10v2.exe" /pintb "C:\Program Files (x86)\Microsoft Office\Office16\EXCEL.exe"
"<path to executable>\PinTo10v2.exe" /pintb "C:\Program Files (x86)\Microsoft Office\Office16\WINWORD.exe"
echo .> "C:\Users\%UserName%\taskbar.txt"
exit
:end
exit
I also added a line in the script to create an empty text file in the root of the users profile, and a IF/IF NOT EXIST query to the script to make sure that the icons didn't keep mapping each login, resulting in Excel 2016 (2), Excel 2016 (3) and so on..
Firstly, anyone who has works with Windows 10 Enterprise needn't worry about this post, as you can simply set your start menu layout, export the layout to an XML file using Powershell and then edit that XML to include the taskbar settings. This can then be deployed to your endpoint machines via GPO. Simple!
For those looking for the documentation, it can be found here: https://docs.microsoft.com/en-us/windows/configuration/windows-10-start-layout-options-and-policies
Of course, if you're using Windows 10 Professional, this becomes problematic.. as the moment you add the taskbar component of that XML file, applying it via GPO causes explorer.exe to end up in an endless crash/restart/crash loop. You can however, still apply your start layout this way without any issues (just don't change the XML file after you've exported it, or it won't work!). It appears that the customisation of Windows 10 Pro isn't entirely supported by Microsoft.
After days of trawling the interwebs looking for a solution, I stumbled across a neat executable written by Stuart Pearson called Pinto10 (https://pinto10blog.wordpress.com/2016/09/10/pinto10/) - which behaves the same way the old Windows 7 "Pinitem.vbs" used to work - It can be called at a command line level, so can be scripted via a simple batch file to do the job.
I extracted the executable to an easily accessible share, and then wrote a quick batch script to map the appropriate shortcuts (a modified version of the script with correct syntax use can be seen below). I then added the batch script as a logon script via GPO (User Configuration > Policies > Windows Settings > Scripts (Logon/Logoff)) , and sure enough, on next login, all my shortcuts exist!
PinitemtoTaskBar.bat
@echo off
IF EXIST C:\Users\%Username%\taskbar.txt goto end
IF NOT EXIST C:\Users\%Username%\taskbar.txt goto addshortcut
:addshortcut
"<path to executable>\PinTo10v2.exe" /pintb "C:\Windows\Explorer.exe"
"<path to executable>\PinTo10v2.exe" /pintb "C:\Program Files\Internet Explorer\iexplore.exe"
"<path to executable>\PinTo10v2.exe" /pintb "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
"<path to executable>\PinTo10v2.exe" /pintb "C:\Program Files (x86)\Microsoft Office\Office16\OUTLOOK.exe"
"<path to executable>\PinTo10v2.exe" /pintb "C:\Program Files (x86)\Microsoft Office\Office16\EXCEL.exe"
"<path to executable>\PinTo10v2.exe" /pintb "C:\Program Files (x86)\Microsoft Office\Office16\WINWORD.exe"
echo .> "C:\Users\%UserName%\taskbar.txt"
exit
:end
exit
I also added a line in the script to create an empty text file in the root of the users profile, and a IF/IF NOT EXIST query to the script to make sure that the icons didn't keep mapping each login, resulting in Excel 2016 (2), Excel 2016 (3) and so on..
Comments
Post a Comment