Customize your Windows 11 (23H2 and onwards) taskbar during OSD with ConfigMgr using just PowerShell

Approximately two years ago, I authored a blog post detailing how to customize the taskbar in Windows 11. You can find that post here: Customize your Windows 11 taskbar during OSD with ConfigMgr using just PowerShell – imab.dk

Since then, there have been some changes from Microsoft, and the method I previously described is no longer supported. For more information on these changes, please refer to: Configure the applications pinned to the taskbar | Microsoft Learn

In summary, the cmdlet Import-StartLayout is no longer supported and does not accept the .xml file, resulting in the following error: Import-StartLayout : The file C:\WINDOWS\Taskbar.xml is not a valid layout file

To address this, I have modified the solution I used back then, and the new approach is outlined in this blog post.

PowerShell

The updated PowerShell script, though not many changes has happened, can be found here: Windows-11/Import-Win1123H2TaskbarLayout.ps1 at main · imabdk/Windows-11 (github.com)

Instead of generating the taskbar.xml and importing it using Import-StartLayout, I’m saving the .xml into the default user: $env:SystemDrive\Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml

Taskbar XML

The generated XML file is tailored for my needs. It replaces the entire taskbar layout and pins explorer, Edge and Outlook as the only shortcuts.

Configuration Manager

Run the script within your Windows 11 OSD task sequence, using the ‘Run PowerShell Script’ step.

For my various customizations (though I try to keep those at an absolute minimum), I’m using a nested task sequence:

When browsing the script in-console, you should have a view similar to below:

Result

As expected, once the device finishes OSD, the taskbar on Windows 11 is trimmed down to the most relevant. From here, the users can pin their own apps as needed.

ENJOY 🙂

Leave a Comment

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