- Midnight Commander remote connect via Shell link (copy files over SSH) and SFTP link using FISH and public key authentication - Mon, Jan 17 2022
- Root login via SSH and SFTP on EC2 instances running Linux - Wed, Jan 12 2022
- Poll: Will you deploy Windows 11 in 2022? - Mon, Jan 10 2022
Taskbar Registry settings ^The configuration of all pinned apps is stored in a Registry key: HKEY_CURRENT_USER > Software > Microsoft > Windows > CurrentVersion > Explorer > Taskband.
Taskband - Registry settings of the pinned apps on the Taskbar
Deploy with Group Policy Preferences ^In a previous post, I explained how you can convert the REG file into an XML file and then import the Registry settings into Group Policy Preferences. This also works with the Taskband Registry key; however, your users will only get the new configuration after they log on the second time. The reason is that Group Policy Preferences deploys Registry settings after Windows Explorer is already loaded. If you restart File Explorer through the Task Manager after the first logon, the Taskbar will load the new settings right away. Hence, one way to deploy your Taskbar configuration is to restart Explorer right after the user logs on with a logon script. You could do this with a little batch script:
taskkill /f /im explorer.exe start explorer.exeYou should use the Group Policy User Configuration > Policies > Administrative Templates > System > Logon for this purpose because the logon scripts in the Windows Settings Group Policy run too early in the logon process.
Run these programs at user logonThe procedure described so far only works with Modern apps. Windows handles shortcuts for desktop applications and Modern apps differently. Whenever you pin a desktop application to the Taskbar, Windows adds the corresponding shortcut to the folder %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\. Thus, in addition to the Registry settings, you have copy the shortcut of the desktop application to this folder. If you don’t do this, users will see the application pinned to the Taskbar; however, when they click it, they will get the error message “Can’t open this item.” This problem doesn’t exist for Modern apps.
“Can’t open this item” messageYou could copy the shortcut with Group Policy Preferences or in your logon script that restarts Explorer. The example below shows what your batch script might look like if you want to pin Notepad to the Taskbar:
xcopy /y "\\win2012r2\scripts\Notepad.lnk" "%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\" taskkill /f /im explorer.exe start explorer.exeIn addition, you have to deploy Registry settings discussed above with Group Policy Preferences. The solution has two downsides. One is that the user will see a command window pop up after logon. Perhaps even more problematic is restarting Explorer after the user logs on. If the user manages to start an application before your script runs, this can cause problems.
Deploy with a logon script only ^A better solution is to work without Group Policy Preferences and to deploy the Registry settings in the logon script. In this case, you work with the logon script configuration under User Configuration > Windows Settings > Scripts (Logon/Logoff).
Windows Settings - Logon scripts
regedit.exe /s \\win2012r2\scripts\Taskband.reg xcopy /y "\\win2012r2\scripts\Notepad.lnk" "%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\"The first line deploys the Registry settings that contain the pinned apps of your Taskband configuration. The user won’t notice anything and will get the correct the Taskbar settings right after logon. A problem with this method is that it only works if File Explorer is started after the Registry settings have been deployed. Hence, you should enable the Group Policy Run logon scripts synchronously, which you can find in User Configuration > Policies > Administrative Templates > System > Scripts. During my tests, the logon scripts always worked without this setting, but I wouldn’t count on it. A downside of this policy is that it can slow down the logon process.
Run logon scripts synchronouslyI think this case demonstrates nicely that Group Policy Preferences can’t always replace logon scripts.
Freeze the Taskbar ^Thus far, we only ensured that users will always get the same Taskbar configuration after they log on. They can still pin and unpin apps to the Taskbar during a session. In some environments, that might make sense. However, if you don’t want to frustrate your users because their Taskbar configuration always changes back to the original setting, you might want to prevent users from changing the pinned apps. This can be done with the Group Policy setting Do not allow pinning programs to the Taskbar, which you can find under User Configuration > Policies > Administrative Templates > Start Menu and Taskbar.
Do not allow pinning programs to the TaskbarNote that this policy doesn’t change the programs currently pinned to the Taskbar. It just removes Pin this program to the Taskbar and Unpin this program from the Taskbar from the context menu when you right-click a Taskbar icon. Also note that the policy doesn’t interfere with the deployment methods described above. Thus, you can still deploy a new REG file with your Taskbar settings without disabling this policy.