Customize your Windows 11 taskbar during OSD with ConfigMgr using just PowerShell

Introduction

A short and sweet blog post to re-kickstart my blogging activities, after a long period focusing on cybersecurity and the increased cybersecurity threat towards organizations. For same reasons, my Windows 11 project has temporarily been on pause.

However, now I’m back working on Windows 11, showing how you can customize the taskbar during OSD (Operating System Deployment) with Configuration Manager using just PowerShell (and no source files).

And yes, we are still leveraging Configuration Manager for regular OSD. This still makes the most sense for our type of business. 🙂

PowerShell

Find the PowerShell script on my GitHub page here: Windows-11/Import-TaskbarLayout.ps1 at main · imabdk/Windows-11 (github.com)

The script is really simple, though the approach I’m using, creates the required XML for your, rather than including it as a source file in ConfigMgr.

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 🙂

22 thoughts on “Customize your Windows 11 taskbar during OSD with ConfigMgr using just PowerShell”

    • Hi Jonas,

      Did you ever figure this out? Even with this powershell script here, the chat icon still exists.

      We’re trying to get rid of it since it launches the consumer version of Teams

      Reply
  1. I was unable to get this to function after mimicking exactly what was above. Nothing changed in the task menu. I applied this after applying the OS in the tasking sequence and booting into the OS

    Reply
  2. Do you have the rest of your TS steps available? I am looking for details on how to Launch Explorer to This PC, and Show This PC on desktop for Windows 11. Thanks in advance!

    Reply
  3. Hi,

    It’s a nice script, thank you for it. Could you please elaborate the thing about removing Chat Icon. I do not see clear from your script how to remove the icon.

    Thank you very much in advance

    Reply
  4. Once you have deployed this in the OSD and you wanted to update the existing machine what’s the best way to do this. It seems using GPO you cant pin icons to the Start Menu

    Reply
  5. Hello,

    FYI – it does’nt work with Windows 11 23H2 July – says:

    Import-StartLayout : The file C:\WINDOWS\Taskbar.xml is not a valid layout file

    I fixed it by using an alternativ to your script

    Best
    Morten

    Reply
  6. I just do it as a PowerShell step, and inside the step i have:

    ‘ | Out-File C:\Users\default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml -Encoding UTF8

    Reply

Leave a Comment

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